tractor/tractor
Tyler Goodlet 250275d98d Guarding for IPC failures in `._runtime._invoke()`
Took me longer then i wanted to figure out the source of
a failed-response to a remote-cancellation (in this case in `modden`
where a client was cancelling a workspace layer.. but disconnects before
receiving the ack msg) that was triggering an IPC error when sending the
error msg for the cancellation of a `Actor._cancel_task()`, but since
this (non-rpc) `._invoke()` task was trying to send to a now
disconnected canceller it was resulting in a `BrokenPipeError` (or similar)
error.

Now, we except for such IPC errors and only raise them when,
1. the transport `Channel` is for sure up (bc ow what's the point of
   trying to send an error on the thing that caused it..)
2. it's definitely for handling an RPC task

Similarly if the entire main invoke `try:` excepts,
- we only hide the call-stack frame from the debugger (with
  `__tracebackhide__: bool`) if it's an RPC task that has a connected
  channel since we always want to see the frame when debugging internal
  task or IPC failures.
- we don't bother trying to send errors to the context caller (actor)
  when it's a non-RPC request since failures on actor-runtime-internal
  tasks shouldn't really ever be reported remotely, only maybe raised
  locally.

Also some other tidying,
- this properly corrects for the self-cancel case where an RPC context
  is cancelled due to a local (runtime) task calling a method like
  `Actor.cancel_soon()`. We now set our own `.uid` as the
  `ContextCancelled.canceller` value so that other-end tasks know that
  the cancellation was due to a self-cancellation by the actor itself.
  We still need to properly test for this though!
- add a more detailed module doc-str.
- more explicit imports for `trio` core types throughout.
2024-01-02 10:23:45 -05:00
..
devx Ignore `greenback` import error if not installed 2023-10-19 12:41:15 -04:00
experimental Move move context code into new `._context` mod 2023-05-15 10:00:45 -04:00
trionics Mk `gather_contexts()` support `@acm`s yielding `None` 2023-09-27 14:05:22 -04:00
__init__.py Add comments around diff between `C/context` refs 2023-10-16 15:45:02 -04:00
_child.py Rename our core module to `_runtime` 2022-09-15 23:41:28 -04:00
_clustering.py Passthrough runtime kwargs from `open_actor_cluster()` 2022-12-11 19:56:08 -05:00
_context.py Be mega-pedantic with `ContextCancelled` semantics 2023-10-23 16:24:54 -04:00
_discovery.py `.discovery.get_arbiter()`: add warning around this now deprecated usage 2023-12-11 19:37:45 -05:00
_entry.py Init-support for "multi homed" transports 2023-09-27 16:25:21 -04:00
_exceptions.py Move `MessagingError` into `._exceptions` set 2023-10-23 14:17:36 -04:00
_forkserver_override.py Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
_ipc.py Tweak `Channel._cancel_called` comment 2023-10-23 17:47:55 -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.. 2023-11-06 15:44:21 -05:00
_portal.py Be ultra-correct in `Portal.open_context()` 2023-10-23 17:34:28 -04:00
_root.py Add `open_root_actor(ensure_registry: bool)` 2023-11-07 16:45:24 -05:00
_runtime.py Guarding for IPC failures in `._runtime._invoke()` 2024-01-02 10:23:45 -05:00
_shm.py Updates from latest `piker.data._sharedmem` changes 2023-06-22 17:16:17 -04:00
_spawn.py More thurough hard kill doc strings 2023-12-11 18:17:42 -05:00
_state.py Move `NoRuntime` import inside `current_actor()` to avoid cycle 2023-05-15 10:00:45 -04:00
_streaming.py Raise a `MessagingError` from the src error on msging edge cases 2023-10-23 14:34:12 -04:00
_supervise.py Change remaining internals to use `Actor.reg_addrs` 2023-10-19 12:40:37 -04:00
log.py .log: more correct handling for `get_logger(__name__)` usage 2023-07-07 14:48:37 -04:00
msg.py Make `NamespacePath` work on object refs 2023-07-12 13:07:30 -04:00
to_asyncio.py Move `.to_asyncio` to modern optional value type annots 2023-07-21 15:08:46 -04:00