aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojciech Kosior <kwojtus@protonmail.com>2020-06-16 21:08:48 +0200
committerWojciech Kosior <kwojtus@protonmail.com>2020-06-16 21:08:48 +0200
commit5a885716a2212c2147bf8c5a8c91be8bf7050b15 (patch)
tree5c95fac4b35878b3e5ab680e5ece8842bfb175bd
parent07f8c9f4f1f62b8fd2e6d281edfdb37da17422cd (diff)
download0tdns-5a885716a2212c2147bf8c5a8c91be8bf7050b15.tar.gz
0tdns-5a885716a2212c2147bf8c5a8c91be8bf7050b15.zip
explain why we put subprocess in the dict
-rwxr-xr-xsrc/hourly.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/hourly.py b/src/hourly.py
index 1bd01b7..5af9e4d 100755
--- a/src/hourly.py
+++ b/src/hourly.py
@@ -218,6 +218,10 @@ def do_hourly_work(hour, logfile):
veth_addr2, route_through_veth, str(vpn_id)] +
command_in_namespace)
+ # we're not actually using the subprocess object anywhere, but we
+ # put it in the dict regardless to keep a reference to it - otherwise
+ # python would reap the child for us and waitpid(0, 0) would raise
+ # '[Errno 10] No child processes' :c
pids_wrappers[p.pid] = (vpn_id, subnet, p)
while len(pids_wrappers) > 0: