From 3ff0a86741836b61c32f0fd0be1b2b227040ef00 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 21 Apr 2025 21:31:13 -0400 Subject: [PATCH] Gracefully close on EoCs thrown in quote throttler Since `tractor.MsgStream.send()` now also raises `trio.EndOfChannel` when the stream was gracefully `Stop`ped by the peer side, also handle that case in `.data._sampling.uniform_rate_send()`. --- piker/data/_sampling.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/piker/data/_sampling.py b/piker/data/_sampling.py index 7bb0231d..37d7623f 100644 --- a/piker/data/_sampling.py +++ b/piker/data/_sampling.py @@ -876,6 +876,7 @@ async def uniform_rate_send( except tractor.RemoteActorError as rme: if rme.type is not tractor._exceptions.StreamOverrun: raise + ctx = stream._ctx chan = ctx.chan log.warning( @@ -892,6 +893,7 @@ async def uniform_rate_send( trio.ClosedResourceError, trio.BrokenResourceError, ConnectionResetError, + trio.EndOfChannel, ): # if the feed consumer goes down then drop # out of this rate limiter