tractor/tractor
Tyler Goodlet b71d96fdee Accept err-type override in `is_multi_cancelled()`
Such that equivalents of `trio.Cancelled` from other runtimes such as
`asyncio.CancelledError` and `subprocess.CalledProcessError` (with
a `.returncode == -2`) can be gracefully ignored as needed by the
caller.

For example this is handy if you want to avoid debug-mode REPL entry on
an exception-group full of only some subset of exception types since you
expect certain tasks to raise such errors after having been cancelled by
a request from some parent supervision sys (some "higher up"
`trio.CancelScope`, a remote triggered `ContextCancelled` or just from
and OS SIGINT).

Impl deats,
- offer a new `ignore_nested: set[BaseException]` param which by
  default we add `trio.Cancelled` to when no other types are provided.
- use `ExceptionGroup.subgroup(tuple(ignore_nested)` to filter to egs of
  the "ignored sub-errors set" and return any such match (instead of
  `True`).
- detail a comment on exclusion case.
2025-03-27 13:24:25 -04:00
..
_testing Move `mk_cmd()` to `._testing` 2025-03-27 13:24:25 -04:00
devx Add TODO for a tb frame "filterer" sys.. 2025-03-27 13:24:25 -04:00
experimental Drop now-deprecated deps on modern `trio`/Python 2025-03-16 16:06:24 -04:00
msg Draft a (pretty)`Struct.fields_diff()` 2025-03-27 13:24:25 -04:00
trionics Change masked `.pause()` line 2025-03-27 13:24:25 -04:00
__init__.py Finally implement peer-lookup optimization.. 2025-03-24 14:04:52 -04:00
_child.py Hide `._entry`/`._child` frames, tweak some more type annots 2025-03-20 23:22:45 -04:00
_clustering.py Passthrough runtime kwargs from `open_actor_cluster()` 2022-12-11 19:56:08 -05:00
_context.py Change masked `.pause()` line 2025-03-27 13:24:25 -04:00
_discovery.py Finally implement peer-lookup optimization.. 2025-03-24 14:04:52 -04:00
_entry.py Pass `infect_asyncio` setting via runtime-vars 2025-03-27 13:24:25 -04:00
_exceptions.py Accept err-type override in `is_multi_cancelled()` 2025-03-27 13:24:25 -04:00
_forkserver_override.py Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
_ipc.py More formal `TransportClosed` reporting/raising 2025-03-24 14:04:52 -04: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 More-n-more scops annots in logging 2025-03-24 14:04:52 -04:00
_root.py Support and test infected-`asyncio`-mode for root 2025-03-27 13:24:25 -04:00
_rpc.py More formal `TransportClosed` reporting/raising 2025-03-24 14:04:52 -04:00
_runtime.py Pass `infect_asyncio` setting via runtime-vars 2025-03-27 13:24:25 -04:00
_spawn.py Use `._entry` proto-ed "lifetime ops" in logging 2025-03-24 14:04:52 -04:00
_state.py Pass `infect_asyncio` setting via runtime-vars 2025-03-27 13:24:25 -04:00
_streaming.py Reraise RAEs in `MsgStream.receive()`; truncate tbs 2025-03-24 14:04:52 -04:00
_supervise.py Pass `infect_asyncio` setting via runtime-vars 2025-03-27 13:24:25 -04:00
log.py Support passing pre-conf-ed `Logger` 2025-03-27 13:24:25 -04:00
to_asyncio.py Support and test infected-`asyncio`-mode for root 2025-03-27 13:24:25 -04:00