From f8e25688c70f482c9a549b4231c83bb515b91f8f Mon Sep 17 00:00:00 2001 From: goodboy Date: Wed, 11 Feb 2026 13:49:52 -0500 Subject: [PATCH] Unmask `ClosedResourceError` handling in `._transport` Unmask the CRE case block for peer-closed socket errors which already had a TODO about reproducing the condition. It appears this case can happen during inter-actor comms teardowns in `piker`, but i haven't been able to figure out exactly what reproduces it yet.. So activate the block again for that 'socket already closed'-msg case, and add a TODO questioning how to reproduce it. (this commit msg was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-code --- tractor/ipc/_transport.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/tractor/ipc/_transport.py b/tractor/ipc/_transport.py index 704c13a6..93652a87 100644 --- a/tractor/ipc/_transport.py +++ b/tractor/ipc/_transport.py @@ -459,21 +459,23 @@ class MsgpackTransport(MsgTransport): ) raise tpt_closed from trans_err - # case trio.ClosedResourceError() if ( - # 'this socket was already closed' - # in - # trans_err.args[0] - # ): - # tpt_closed = TransportClosed.from_src_exc( - # message=( - # f'{tpt_name} already closed by peer\n' - # ), - # body=f'{self}\n', - # src_exc=trans_err, - # raise_on_report=True, - # loglevel='transport', - # ) - # raise tpt_closed from trans_err + # ??TODO??, what case in piker does this and HOW + # CAN WE RE-PRODUCE IT?!?!? + case trio.ClosedResourceError() if ( + 'this socket was already closed' + in + trans_err.args[0] + ): + tpt_closed = TransportClosed.from_src_exc( + message=( + f'{tpt_name} already closed by peer\n' + ), + body=f'{self}\n', + src_exc=trans_err, + raise_on_report=True, + loglevel='transport', + ) + raise tpt_closed from trans_err # unless the disconnect condition falls under "a # normal operation breakage" we usualy console warn