forked from goodboy/tractor
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
parent
be22a2526a
commit
29fd956077
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue