Skip to content

Commit

Permalink
Ignore drainer-task nursery RTE during context exit
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Apr 14, 2023
1 parent f1ee3c1 commit d4782d8
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions tractor/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ async def _maybe_cancel_and_set_remote_error(
# from ._debug import breakpoint
# await breakpoint()


# XXX: this will break early callee results sending
# since when `.result()` is finally called, this
# chan will be closed..
Expand Down Expand Up @@ -966,8 +965,12 @@ async def _deliver_msg(

local_uid = current_actor().uid
lines = [
f'Actor-task context {cid}@{local_uid} was overrun by remote!',
f'sender actor: {uid}',
f'OVERRUN on actor-task context {cid}@{local_uid}!\n'
# TODO: put remote task name here if possible?
f'remote sender actor: {uid}',
# TODO: put task func name here and maybe an arrow
# from sender to overrunner?
# f'local task {self.func_name}'
]
if not self._stream_opened:
lines.insert(
Expand All @@ -988,13 +991,17 @@ async def _deliver_msg(
):
self._overflow_q.append(msg)
n = self._scope_nursery
if n.child_tasks:
from . import _debug
await _debug.breakpoint()
assert not n.child_tasks
n.start_soon(
self._drain_overflows,
)
try:
n.start_soon(
self._drain_overflows,
)
except RuntimeError:
# if the nursery is already cancelled due to
# this context exiting or in error, we ignore
# the nursery error since we never expected
# anything different.
return False
else:
try:
raise StreamOverrun(text)
Expand Down

0 comments on commit d4782d8

Please sign in to comment.