Only warn on `trio.BrokenResourceError`s from `_invoke()`

sigintsaviour_ci_worked
Tyler Goodlet 2022-02-18 12:19:41 -05:00
parent 7ecc48b3c9
commit 1fd4588243
1 changed files with 11 additions and 2 deletions

View File

@ -240,7 +240,10 @@ async def _invoke(
task_status.started(cs) task_status.started(cs)
await chan.send({'return': await coro, 'cid': cid}) 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): if not is_multi_cancelled(err):
@ -274,7 +277,13 @@ async def _invoke(
try: try:
await chan.send(err_msg) 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 # if we can't propagate the error that's a big boo boo
log.error( log.error(
f"Failed to ship error to caller @ {chan.uid} !?" f"Failed to ship error to caller @ {chan.uid} !?"