diff --git a/tractor/_context.py b/tractor/_context.py index c5b4afc5..5a69077e 100644 --- a/tractor/_context.py +++ b/tractor/_context.py @@ -2429,11 +2429,7 @@ async def open_context_from_portal( try: # await pause(shield=True) await ctx.cancel() - except ( - trio.BrokenResourceError, - trio.ClosedResourceError, - TransportClosed, - ): + except TransportClosed: log.warning( 'IPC connection for context is broken?\n' f'task: {ctx.cid}\n' diff --git a/tractor/_portal.py b/tractor/_portal.py index a914bb80..2fc9dbb7 100644 --- a/tractor/_portal.py +++ b/tractor/_portal.py @@ -329,18 +329,7 @@ class Portal: # if we get here some weird cancellation case happened return False - except ( - # XXX, should never really get raised unless we aren't - # wrapping them in the below type by mistake? - # - # Leaving the catch here for now until we're very sure - # all the cases (for various tpt protos) have indeed been - # re-wrapped ;p - trio.ClosedResourceError, - trio.BrokenResourceError, - - TransportClosed, - ) as tpt_err: + except TransportClosed as tpt_err: ipc_borked_report: str = ( f'IPC for actor already closed/broken?\n\n' f'\n' diff --git a/tractor/_rpc.py b/tractor/_rpc.py index 801ab672..bd26b5ed 100644 --- a/tractor/_rpc.py +++ b/tractor/_rpc.py @@ -935,6 +935,11 @@ async def try_ship_error_to_remote( # XXX NOTE XXX in SC terms this is one of the worst things # that can happen and provides for a 2-general's dilemma.. + # + # FURHTER, we should never really have to handle these + # lowlevel excs from `trio` since the `Channel.send()` layers + # downward should be mostly wrapping such cases in a + # tpt-closed; the `.critical()` usage is warranted. except ( trio.ClosedResourceError, trio.BrokenResourceError, diff --git a/tractor/_streaming.py b/tractor/_streaming.py index cf3eaab0..56e0607a 100644 --- a/tractor/_streaming.py +++ b/tractor/_streaming.py @@ -410,10 +410,7 @@ class MsgStream(trio.abc.Channel): # it). with trio.CancelScope(shield=True): await self._ctx.send_stop() - except ( - trio.BrokenResourceError, - trio.ClosedResourceError, TransportClosed, ) as re: # the underlying channel may already have been pulled @@ -595,8 +592,6 @@ class MsgStream(trio.abc.Channel): ), ) except ( - trio.ClosedResourceError, - trio.BrokenResourceError, BrokenPipeError, TransportClosed, ) as _trans_err: