forked from goodboy/tractor
1
0
Fork 0

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.
sync_cancel
Tyler Goodlet 2020-11-16 00:01:21 -05:00
parent be22a2526a
commit 29fd956077
1 changed files with 1 additions and 0 deletions
tractor

View File

@ -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