forked from goodboy/tractor
1
0
Fork 0

Go back to only logging crashes if no pdb gets engaged

round_2_ci_windows
Tyler Goodlet 2021-06-29 15:55:03 -04:00
parent 9ddb654783
commit 2513c652c1
1 changed files with 26 additions and 15 deletions

View File

@ -195,21 +195,32 @@ async def _invoke(
except (Exception, trio.MultiError) as err: except (Exception, trio.MultiError) as err:
# TODO: maybe we'll want differnet "levels" of debugging if not is_multi_cancelled(err):
# eventualy such as ('app', 'supervisory', 'runtime') ?
if ( log.exception("Actor crashed:")
not is_multi_cancelled(err) and (
not isinstance(err, ContextCancelled) or # TODO: maybe we'll want different "levels" of debugging
(isinstance(err, ContextCancelled) and ctx._cancel_called) # eventualy such as ('app', 'supervisory', 'runtime') ?
)
): # if not isinstance(err, trio.ClosedResourceError) and (
# XXX: is there any case where we'll want to debug IPC # if not is_multi_cancelled(err) and (
# disconnects? I can't think of a reason that inspecting
# this type of failure will be useful for respawns or entered_debug: bool = False
# recovery logic - the only case is some kind of strange bug if not isinstance(err, ContextCancelled) or (
# in `trio` itself? isinstance(err, ContextCancelled) and ctx._cancel_called
entered = await _debug._maybe_enter_pm(err) ):
if not entered: # XXX: is there any case where we'll want to debug IPC
# disconnects as a default?
#
# I can't think of a reason that inspecting
# this type of failure will be useful for respawns or
# recovery logic - the only case is some kind of strange bug
# in our transport layer itself? Going to keep this
# open ended for now.
entered_debug = await _debug._maybe_enter_pm(err)
if not entered_debug:
log.exception("Actor crashed:") log.exception("Actor crashed:")
# always ship errors back to caller # always ship errors back to caller