From 175fac735c862231e2bda45208257999ec0b068c Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Thu, 10 Nov 2016 16:35:13 +0100 Subject: [PATCH] All worker processes are killed on shutdown. --- BUGS | 3 ++- vigil | 1 + worker.py | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/BUGS b/BUGS index fd577a5..583ed81 100644 --- a/BUGS +++ b/BUGS @@ -1,5 +1,4 @@ Current -- The worker processes are left over after vigil stops. (In sandbox or not) - The brightness of the summary's title slightly changes when focused. - When paging the summary window, with the bottom scroll bar showing, the cursor line drifts up or down a row. @@ -241,6 +240,8 @@ Fixed - sandbox_fs_test.py is failing when run by the vigil that was started in my startup script, but passing otherwise. <- sandbox_fs_test.py is totally different now. +- The worker processes are left over after vigil stops. (In sandbox or not) + Won't fix - If the summary window is narrower then max_path_length the paths are never diff --git a/vigil b/vigil index 1316c02..ecfde31 100755 --- a/vigil +++ b/vigil @@ -570,6 +570,7 @@ class Screen: worker_.future.cancel() if worker_.result is not None: worker_.result.reset() + worker_.kill() def _partition(self, widgets, height): smaller_height = max(height // 4, 10) diff --git a/worker.py b/worker.py index 0667e58..9e0f071 100755 --- a/worker.py +++ b/worker.py @@ -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)