Skip to content

Commit

Permalink
Go back to only logging crashes if no pdb gets engaged
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Jul 5, 2021
1 parent 4d4ed75 commit afeeecf
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions tractor/_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,21 +195,32 @@ async def _invoke(

except (Exception, trio.MultiError) as err:

# TODO: maybe we'll want differnet "levels" of debugging
# eventualy such as ('app', 'supervisory', 'runtime') ?
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
# this type of failure will be useful for respawns or
# recovery logic - the only case is some kind of strange bug
# in `trio` itself?
entered = await _debug._maybe_enter_pm(err)
if not entered:
if not is_multi_cancelled(err):

log.exception("Actor crashed:")

# TODO: maybe we'll want different "levels" of debugging
# eventualy such as ('app', 'supervisory', 'runtime') ?

# if not isinstance(err, trio.ClosedResourceError) and (
# if not is_multi_cancelled(err) and (

entered_debug: bool = False
if 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 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:")

# always ship errors back to caller
Expand Down

0 comments on commit afeeecf

Please sign in to comment.