From 38ffb875bdcb8ecc10149143349a3fdf5b9a7f9e Mon Sep 17 00:00:00 2001 From: goodboy Date: Thu, 7 May 2026 16:39:10 -0400 Subject: [PATCH] Add `ActorTooSlowError` for cancel-cascade timeouts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Distinct from `trio.TooSlowError` so that existing `except trio.TooSlowError:` blocks don't silently mask actor-cancel timeouts — these must propagate to let a supervisor escalate to `proc.terminate()` per SC-discipline: graceful cancel-req -> bounded wait -> hard-kill Motivated by #subint_forkserver dup-name hang where `Portal.cancel_actor()` silently swallowed the timeout and the supervisor never escalated, leaving a same-named sibling subactor parked forever. (this commit msg was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-code --- tractor/_exceptions.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tractor/_exceptions.py b/tractor/_exceptions.py index 5ec9cbd5..3b087184 100644 --- a/tractor/_exceptions.py +++ b/tractor/_exceptions.py @@ -89,6 +89,28 @@ class ActorFailure(RuntimeFailure): ''' +class ActorTooSlowError(RuntimeFailure): + ''' + A peer-`Actor` failed to ack an actor-runtime cancel-cascade + request (e.g. `Portal.cancel_actor()` -> `Actor.cancel()`) + within the bounded wait window. + + Distinct exc-type (NOT a `trio.TooSlowError` subclass) so that + `except trio.TooSlowError:` blocks elsewhere in the test-suite + or `tractor` internals do NOT silently mask actor-cancel + timeouts — these MUST propagate so a supervisor can escalate + to `proc.terminate()` (hard-kill) per SC-discipline: + + graceful cancel-req -> bounded wait -> hard-kill + + Reason: see #subint_forkserver duplicate-name hang + diagnosis where `Portal.cancel_actor()` silently swallowed + the timeout and the supervisor never escalated, leaving + a same-named sibling subactor parked forever. + + ''' + + class InternalError(RuntimeError): ''' Entirely unexpected internal machinery error indicating