From e26fa8330f050e1ac16829d74361c2fc001e452b Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 9 Dec 2024 18:04:32 -0500 Subject: [PATCH] Change masked `.pause()` line --- tractor/_context.py | 21 +++++++++++++++++---- tractor/trionics/_broadcast.py | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/tractor/_context.py b/tractor/_context.py index 167aad6..4a20c2b 100644 --- a/tractor/_context.py +++ b/tractor/_context.py @@ -1703,15 +1703,28 @@ class Context: # TODO: expose as mod func instead! structfmt = pretty_struct.Struct.pformat if self._in_overrun: - log.warning( - f'Queueing OVERRUN msg on caller task:\n\n' - + report: str = ( f'{flow_body}' - f'{structfmt(msg)}\n' ) + over_q: deque = self._overflow_q self._overflow_q.append(msg) + if len(over_q) == over_q.maxlen: + report = ( + 'FAILED to queue OVERRUN msg, OVERAN the OVERRUN QUEUE !!\n\n' + + report + ) + # log.error(report) + log.debug(report) + + else: + report = ( + 'Queueing OVERRUN msg on caller task:\n\n' + + report + ) + log.debug(report) + # XXX NOTE XXX # overrun is the ONLY case where returning early is fine! return False diff --git a/tractor/trionics/_broadcast.py b/tractor/trionics/_broadcast.py index 977b682..154b037 100644 --- a/tractor/trionics/_broadcast.py +++ b/tractor/trionics/_broadcast.py @@ -382,7 +382,7 @@ class BroadcastReceiver(ReceiveChannel): # likely it makes sense to unwind back to the # underlying? # import tractor - # await tractor.breakpoint() + # await tractor.pause() log.warning( f'Only one sub left for {self}?\n' 'We can probably unwind from breceiver?'