From 7bb5addd4c67785a41de0a26fef2d746dd5b9202 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 18 Feb 2022 12:19:41 -0500 Subject: [PATCH] Only warn on `trio.BrokenResourceError`s from `_invoke()` --- tractor/_actor.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tractor/_actor.py b/tractor/_actor.py index ad83966..2e65dd2 100644 --- a/tractor/_actor.py +++ b/tractor/_actor.py @@ -240,7 +240,10 @@ async def _invoke( task_status.started(cs) await chan.send({'return': await coro, 'cid': cid}) - except (Exception, trio.MultiError) as err: + except ( + Exception, + trio.MultiError + ) as err: if not is_multi_cancelled(err): @@ -274,7 +277,13 @@ async def _invoke( try: await chan.send(err_msg) - except trio.ClosedResourceError: + # TODO: tests for this scenario: + # - RPC caller closes connection before getting a response + # should **not** crash this actor.. + except ( + trio.ClosedResourceError, + trio.BrokenResourceError, + ): # if we can't propagate the error that's a big boo boo log.error( f"Failed to ship error to caller @ {chan.uid} !?"