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

3
BUGS
View file

@ -1,5 +1,4 @@
Current 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. - The brightness of the summary's title slightly changes when focused.
- When paging the summary window, with the bottom scroll bar showing, the - When paging the summary window, with the bottom scroll bar showing, the
cursor line drifts up or down a row. 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 - sandbox_fs_test.py is failing when run by the vigil that was started in
my startup script, but passing otherwise. my startup script, but passing otherwise.
<- sandbox_fs_test.py is totally different now. <- sandbox_fs_test.py is totally different now.
- The worker processes are left over after vigil stops. (In sandbox or not)
Won't fix Won't fix
- If the summary window is narrower then max_path_length the paths are never - If the summary window is narrower then max_path_length the paths are never

1
vigil
View file

@ -570,6 +570,7 @@ class Screen:
worker_.future.cancel() worker_.future.cancel()
if worker_.result is not None: if worker_.result is not None:
worker_.result.reset() worker_.result.reset()
worker_.kill()
def _partition(self, widgets, height): def _partition(self, widgets, height):
smaller_height = max(height // 4, 10) smaller_height = max(height // 4, 10)

View file

@ -75,6 +75,10 @@ class Worker:
self.result.set_status(tools.Status.running) self.result.set_status(tools.Status.running)
os.killpg(self.child_pgid, signal.SIGCONT) 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(): def main():
print(os.getpgid(os.getpid()), flush=True) print(os.getpgid(os.getpid()), flush=True)