All worker processes are killed on shutdown.

This commit is contained in:
Andrew Hamilton 2016-11-10 16:35:13 +01:00
parent 7d46254edb
commit 175fac735c
3 changed files with 7 additions and 1 deletions

View file

@ -75,6 +75,10 @@ class Worker:
self.result.set_status(tools.Status.running)
os.killpg(self.child_pgid, signal.SIGCONT)
def kill(self):
if self.child_pgid is not None:
os.killpg(self.child_pgid, signal.SIGKILL)
def main():
print(os.getpgid(os.getpid()), flush=True)