From 5a885716a2212c2147bf8c5a8c91be8bf7050b15 Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Tue, 16 Jun 2020 21:08:48 +0200 Subject: explain why we put subprocess in the dict --- src/hourly.py | 4 ++++ 1 file changed, 4 insertions(+) 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: -- cgit v1.2.3