From 29fd9560774f1f60050d50ec845a116e8748aa16 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 16 Nov 2020 00:01:21 -0500 Subject: [PATCH] Make SIGINT handler kill the process tree The std lib's `pdb` internals override SIGINT handling whenever one enters the debugger repl. Force a handler that kills the tree if SIGINT is triggered from the root actor, otherwise igore it since supervised children should be managed already. This resolves an issue with guest mode where `pdb` causes SIGINTs to be swallowed resulting in the host loop never terminating the process tree. --- tractor/_debug.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tractor/_debug.py b/tractor/_debug.py index 6040d3f..b690ce5 100644 --- a/tractor/_debug.py +++ b/tractor/_debug.py @@ -248,6 +248,7 @@ def _breakpoint(debug_func) -> Awaitable[None]: # may have the tty locked prior if _debug_lock.locked(): # root process already has it; ignore return + await _debug_lock.acquire() _pdb_release_hook = _debug_lock.release