forked from goodboy/tractor
1
0
Fork 0

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

310_plus
Tyler Goodlet 2022-02-18 12:19:41 -05:00
parent 83ed2f6286
commit 07ac6eb5d0
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} !?"