Add `ActorTooSlowError` for cancel-cascade timeouts

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
subint_forkserver_backend
Gud Boi 2026-05-07 16:39:10 -04:00
parent 4c00913b3b
commit 38ffb875bd
1 changed files with 22 additions and 0 deletions

View File

@ -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): class InternalError(RuntimeError):
''' '''
Entirely unexpected internal machinery error indicating Entirely unexpected internal machinery error indicating