From af013912acbb5aabadae26d168ae5c45599c9f71 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 9 Apr 2024 13:58:10 -0400 Subject: [PATCH] Relay `MsgTypeError`s upward in RPC loop via `._deliver_ctx_payload()` --- tractor/_rpc.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tractor/_rpc.py b/tractor/_rpc.py index d935909..a95dbfe 100644 --- a/tractor/_rpc.py +++ b/tractor/_rpc.py @@ -47,12 +47,13 @@ from ._context import ( Context, ) from ._exceptions import ( - ModuleNotExposed, - is_multi_cancelled, ContextCancelled, + ModuleNotExposed, + MsgTypeError, + TransportClosed, + is_multi_cancelled, pack_error, unpack_error, - TransportClosed, ) from .devx import ( maybe_wait_for_debugger, @@ -636,7 +637,7 @@ async def _invoke( # (callee) task, so relay this cancel signal to the # other side. ctxc = ContextCancelled( - msg, + message=msg, boxed_type=trio.Cancelled, canceller=canceller, ) @@ -826,7 +827,12 @@ async def process_messages( | Stop(cid=cid) | Return(cid=cid) | CancelAck(cid=cid) - | Error(cid=cid) # RPC-task ctx specific + + # `.cid` means RPC-ctx-task specific + | Error(cid=cid) + + # recv-side `MsgType` decode violation + | MsgTypeError(cid=cid) ): # deliver response to local caller/waiter # via its per-remote-context memory channel.