tractor/tractor
Tyler Goodlet b3d348ee6a WIP, actor-nursery non-graceful-cancel raises EG
Attempting a rework of the post-cancellation "raising semantics" such
that subactors which are `ActorCancelled` as a result of a non-graceful
in-scope error, are acked via a re-raised
`ExceptionGroup[ActorCancelled*N, Exception]`
*outside the an-block*. Eventually, the idea is to have `ActorCancelled`
be relayed from each subactor in response to any
`Actor.cancel()/Portal.cancel_actor()` request much like
`Context.cancel()/ContextCancelled`.

This is a WIP bc it does break a few tests and requires related
`_spawn`-mod-machinery changes to match some of which I'm not yet sure
are required; need to dig into to the details of the currently failing
suites first.

`._supervise` patch deats,
- add `ActorNursery.maybe_error` which delivers the maybe-EG or
  `._scope_error` depending on `.errors` (now `._errors`, a mapping from
  `Aid`-keys) has entries seet for subs.
- raise ^ if non-null in a new outer-`finally` in
  `_open_and_supervise_one_cancels_all_nursery()`; an "outer" block is
  added to ensure all sub-actor-excs are emited/captured as part of
  `ActorNursery.cancel()` being called (as prior) as well as the
  `da_nursery` being explicitly cancelled alongside it (to unblock the
  tn-block, but still not sure why this is necessary yet?..).
- (now masked) tried injecting actorcs from `.cancel()` loop, but (again
  per more explanation in section below) seems to be suffering a race
  issue with RAE relay?
- left in buncha notes obvi for all this..

`._spawn` patch deats,
- as above, expect `errors: dict` to map from `Aid`-keys.
- pass `errors: dict` into `soft_kill()` since it seemed like we'd want
  to (for now) inject `ActoreCancelled` in some cases (but now i'm not
  sure XD).
- tried out a couple spots (which are now masked) to inject
  `ActorCancelled` after calling `Portal.cancel()` in various
  subactor-supervision routines whenev an RAE is not set..
  - oddly seems to be overwriting actual errors (likely due to racing
    with RAE receive and/or actorc-request timeout?) despite the guard
    logic..which clearly doesn't resolve the issue..
- buncha `tn`-style renaming.
2025-08-20 13:00:46 -04:00
..
_testing Mk `.devx._debug` a sub-pkg `.devx.debug` 2025-07-14 00:00:12 -04:00
devx Heh, add back `Actor._root_tn`, it has purpose.. 2025-08-20 10:18:52 -04:00
experimental Add API-modernize-todo on `experimental._pubsub.fan_out_to_ctxs` 2025-07-08 18:05:05 -04:00
ipc Always pass a `tn` to `._server._serve_ipc_eps()` 2025-08-20 11:30:58 -04:00
msg Update buncha log msg fmting in `.msg._ops` 2025-08-15 16:30:10 -04:00
trionics Drop more `typing.Optional` usage 2025-08-20 12:45:49 -04:00
__init__.py move tractor._ipc.py into tractor.ipc._chan.py 2025-07-08 12:57:28 -04:00
_addr.py Move concrete `Address`es to each tpt module 2025-07-08 18:05:05 -04:00
_child.py Adjust `._child` instantiation of `Actor` to use newly named `uuid` arg 2025-07-08 12:57:28 -04:00
_clustering.py Fix cluster suite, chng to new `gather_contexts()` 2025-08-18 10:46:37 -04:00
_context.py Handle "out-of-layer" remote `Context` cancellation 2025-08-18 21:30:48 -04:00
_discovery.py Add todo for `tn` to `gather_contexts()` from `find_actor()`? 2025-08-20 13:00:46 -04:00
_entry.py Drop `actor_info: str` from `._entry` logs 2025-08-15 16:24:06 -04:00
_exceptions.py TOSQUASH 313ad93: yeah dun use `._message` as tb-str.. 2025-08-20 13:00:46 -04:00
_forkserver_override.py Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
_mp_fixup_main.py Avoid importing mp for as long as possible 2022-02-17 11:55:26 -05:00
_multiaddr.py Fix doc string "its" typo.. 2025-03-20 19:50:31 -04:00
_portal.py Set `Channel._cancel_called` via `chan` var 2025-08-18 21:30:48 -04:00
_root.py Hide `collapse_eg()` frame as used from `open_root_actor()` 2025-08-20 10:44:42 -04:00
_rpc.py Drop `tn` arg to `maybe_raise_from_masking_exc()` in `._rpc` 2025-08-20 12:45:49 -04:00
_runtime.py Comment/docs tweaks per copilot reivew 2025-08-20 12:36:08 -04:00
_spawn.py WIP, actor-nursery non-graceful-cancel raises EG 2025-08-20 13:00:46 -04:00
_state.py Add initial `repl_fixture` support B) 2025-07-14 00:00:12 -04:00
_streaming.py Mk `.devx._debug` a sub-pkg `.devx.debug` 2025-07-14 00:00:12 -04:00
_supervise.py WIP, actor-nursery non-graceful-cancel raises EG 2025-08-20 13:00:46 -04:00
log.py .log: expose `at_least_level()` as `StackLevelAdapter` meth 2025-08-15 17:29:22 -04:00
to_asyncio.py Comment tweaks per copilot review 2025-08-19 12:33:47 -04:00