From 8908e1283b10b5e38c6a2762ce87e5a6db23087a Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 12 Mar 2025 16:41:42 -0400 Subject: [PATCH] Add `.runtime()`-emit to `._invoke()` to report final result msg in the child --- tractor/_rpc.py | 4 ++++ tractor/_runtime.py | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tractor/_rpc.py b/tractor/_rpc.py index 086cfff6..c5daed9e 100644 --- a/tractor/_rpc.py +++ b/tractor/_rpc.py @@ -649,6 +649,10 @@ async def _invoke( ) # set and shuttle final result to "parent"-side task. ctx._result = res + log.runtime( + f'Sending result msg and exiting {ctx.side!r}\n' + f'{return_msg}\n' + ) await chan.send(return_msg) # NOTE: this happens IFF `ctx._scope.cancel()` is diff --git a/tractor/_runtime.py b/tractor/_runtime.py index e7faaedf..890a690a 100644 --- a/tractor/_runtime.py +++ b/tractor/_runtime.py @@ -836,8 +836,10 @@ class Actor: )] except KeyError: report: str = ( - 'Ignoring invalid IPC ctx msg!\n\n' - f'<=? {uid}\n\n' + 'Ignoring invalid IPC msg!?\n' + f'Ctx seems to not/no-longer exist??\n' + f'\n' + f'<=? {uid}\n' f' |_{pretty_struct.pformat(msg)}\n' ) match msg: