Compare commits

..

2 Commits

Author SHA1 Message Date
Gud Boi 7d594a44b5 Add masked crash-handler cm for debugging wonky inter-actor comms (teardowns) 2026-02-11 14:09:01 -05:00
Gud Boi a2014907bb 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
2026-02-11 13:49:52 -05:00
2 changed files with 20 additions and 15 deletions

View File

@ -497,6 +497,9 @@ async def _connect_chan(
teardown.
'''
# XXX, ONLY uncomment for tracing lowlevel connection issues.
# from tractor.devx import open_crash_handler
# with open_crash_handler():
chan = await Channel.from_addr(addr)
yield chan
with trio.CancelScope(shield=True):

View File

@ -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