forked from goodboy/tractor
1
0
Fork 0
tractor/tractor
Tyler Goodlet d280c26f15 Only cancel/get-result from a ctx if transport is up
There's no point in sending a cancel message to the remote linked task
and especially no reason to block waiting on a result from that task if
the transport layer is detected to be disconnected. We expect that the
transport shouldn't go down at the layer of the message loop
(reconnection logic should be handled in the transport layer itself) so
if we detect the channel is not connected we don't bother requesting
cancels nor waiting on a final result message.

Why?

- if the connection goes down in error the caller side won't have a way
  to know "how long" it should block to wait for a cancel ack or result
  and causes a potential hang that may require an additional ctrl-c from
  the user especially if using the debugger or if the traceback is not
  seen on console.
- obviously there's no point in waiting for messages when there's no
  transport to deliver them XD

Further, add some more detailed cancel logging detailing the task and
actor ids.
2022-07-27 11:37:59 -04:00
..
experimental Better idea: start a `tractor.experimental` subpkg 2022-01-29 14:03:55 -05:00
testing Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
trionics Type fix 2022-02-15 08:51:25 -05:00
__init__.py Add `tractor.query_actor()` an addr looker-upper 2022-04-13 07:50:42 -04:00
_actor.py Fix type annot 2022-02-15 08:52:04 -05:00
_child.py Support asyncio actors with the trio spawner backend 2021-12-17 09:38:01 -05:00
_clustering.py Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
_debug.py Typing fixes, simplify `_set_trace()` 2022-07-27 11:37:59 -04:00
_discovery.py Fix typing 2022-04-13 08:20:53 -04:00
_entry.py More doc string style tweaks 2021-12-17 09:38:04 -05:00
_exceptions.py Re-wrap and raise `asyncio.CancelledError` 2021-12-17 09:38:04 -05:00
_forkserver_override.py Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
_ipc.py Use `str` | `bytes` union for typing msg dump 2022-07-12 11:59:11 -04:00
_mp_fixup_main.py Avoid importing mp for as long as possible 2022-02-17 11:55:26 -05:00
_portal.py Only cancel/get-result from a ctx if transport is up 2022-07-27 11:37:59 -04:00
_root.py WIP redo asyncio async gen streaming 2021-12-17 09:38:04 -05:00
_spawn.py Fix one missing import/ref 2022-02-17 13:03:37 -05:00
_state.py Avoid importing mp for as long as possible 2022-02-17 11:55:26 -05:00
_streaming.py Only cancel/get-result from a ctx if transport is up 2022-07-27 11:37:59 -04:00
_supervise.py Avoid importing mp for as long as possible 2022-02-17 11:55:26 -05:00
log.py Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
msg.py Slight doc string update 2022-01-30 12:21:41 -05:00
to_asyncio.py Slight lint fixes 2022-07-15 11:18:48 -04:00