From 80835d4e04fe86bda09c6dc458a4fce4080b5c8b Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 1 Jun 2022 15:01:30 -0400 Subject: [PATCH] More detailed rt feed drop logging --- piker/data/_sampling.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/piker/data/_sampling.py b/piker/data/_sampling.py index fda93e21..77b15d7f 100644 --- a/piker/data/_sampling.py +++ b/piker/data/_sampling.py @@ -336,7 +336,8 @@ async def sample_and_broadcast( key = id(stream) overruns[key] += 1 log.warning( - f'Feed overrun {bus.brokername} -> ' + f'Feed overrun {broker_symbol}' + '@{bus.brokername} -> ' f'feed @ {tick_throttle} Hz' ) if overruns[key] > 6: @@ -375,11 +376,12 @@ async def sample_and_broadcast( trio.ClosedResourceError, trio.EndOfChannel, ): - ctx = getattr(stream, '_ctx', None) + chan = ctx.chan if ctx: log.warning( - f'{ctx.chan.uid} dropped ' - '`brokerd`-quotes-feed connection' + 'Dropped `brokerd`-quotes-feed connection:\n' + f'{broker_symbol}:' + f'{ctx.cid}@{chan.uid}' ) if tick_throttle: assert stream._closed @@ -392,7 +394,11 @@ async def sample_and_broadcast( try: subs.remove((stream, tick_throttle)) except ValueError: - log.error(f'{stream} was already removed from subs!?') + log.error( + f'Stream was already removed from subs!?\n' + f'{broker_symbol}:' + f'{ctx.cid}@{chan.uid}' + ) # TODO: a less naive throttler, here's some snippets: