Don't enter debug on closed resource errors

round_2_ci_windows
Tyler Goodlet 2021-07-05 14:03:14 -04:00
parent 98bbf8e0df
commit 12f987514d
1 changed files with 10 additions and 8 deletions

View File

@ -197,9 +197,11 @@ async def _invoke(
# TODO: maybe we'll want differnet "levels" of debugging
# eventualy such as ('app', 'supervisory', 'runtime') ?
if not isinstance(err, trio.ClosedResourceError) and (
not is_multi_cancelled(err)) and (
not isinstance(err, ContextCancelled)
if (
not is_multi_cancelled(err) and (
not isinstance(err, ContextCancelled) or
(isinstance(err, ContextCancelled) and ctx._cancel_called)
)
):
# XXX: is there any case where we'll want to debug IPC
# disconnects? I can't think of a reason that inspecting
@ -519,10 +521,10 @@ class Actor:
send_chan, recv_chan = self._cids2qs[(chan.uid, cid)]
assert send_chan.cid == cid # type: ignore
if 'error' in msg:
ctx = getattr(recv_chan, '_ctx', None)
# if ctx:
# ctx._error_from_remote_msg(msg)
# if 'error' in msg:
# ctx = getattr(recv_chan, '_ctx', None)
# if ctx:
# ctx._error_from_remote_msg(msg)
# log.debug(f"{send_chan} was terminated at remote end")
# # indicate to consumer that far end has stopped