From 65540f3e2adc34fc311d4bfb35c6088ab1187a07 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 2 Aug 2022 15:29:33 -0400 Subject: [PATCH] Add nooz --- nooz/165.feature.rst | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 nooz/165.feature.rst diff --git a/nooz/165.feature.rst b/nooz/165.feature.rst new file mode 100644 index 0000000..8eb6a52 --- /dev/null +++ b/nooz/165.feature.rst @@ -0,0 +1,36 @@ +Add SIGINT protection to our `pdbpp` based debugger subystem such that +for (single-depth) actor trees in debug mode we ignore interrupts in any +actor currently holding the TTY lock thus avoiding clobbering IPC +connections and/or task and process state when working in the REPL. + +As a big note currently so called "nested" actor trees (trees with +actors having more then one parent/ancestor) are not fully supported +since we don't yet have a mechanism to relay the debug mode knowledge +"up" the actor tree (for eg. when handling a crash in a leaf actor). +As such currently there is a set of tests and known scenarios which will +result in process cloberring by the zombie repaing machinery and these +have been documented in https://github.com/goodboy/tractor/issues/320. + +The implementation details include: + +- utilizing a custom SIGINT handler which we apply whenever an actor's + runtime enters the debug machinery, which we also make sure the + stdlib's `pdb` configuration doesn't override (which it does by + default without special instance config). +- litter the runtime with `maybe_wait_for_debugger()` mostly in spots + where the root actor should block before doing embedded nursery + teardown ops which both cancel potential-children-in-deubg as well + as eventually trigger zombie reaping machinery. +- hardening of the TTY locking semantics/API both in terms of IPC + terminations and cancellation and lock release determinism from + sync debugger instance methods. +- factoring of locking infrastructure into a new `._debug.Lock` global + which encapsulates all details of the ``trio`` sync primitives and + task/actor uid management and tracking. + +We also add `ctrl-c` cases throughout the test suite though these are +disabled for py3.9 (`pdbpp` UX differences that don't seem worth +compensating for, especially since this will be our last 3.9 supported +release) and there are a slew of marked cases that aren't expected to +work in CI more generally (as mentioned in the "nested" tree note +above) despite seemingly working when run manually on linux.