Tpt-tolerance adjustments for latest tractor #73

Merged
goodboy merged 4 commits from tpt_closed_and_finally_footguns into main 2026-02-23 03:08:19 +00:00

Updates to sync us with the recently landed transport disconnect tolerance improvements landed upstream in,

https://github.com/goodboy/tractor/pull/411

More or less just some changes so we expect tractor.TransportClosed throughout various subsystem’s IPC disconnect handling.


Summary of tweaks,

  • .data._sampling, include it in the Sampler.bcast_errors set.

  • .clearing._ems, include it in the Router.client_broadcast() handler’s set.

  • in .data._web_bs, this patch additionally adds a try/except handler around open_autorecon_ws() to avoid propagating benign NoBsWs.recon_errors caught during full ws-reconnect sequencing.

Updates to sync us with the recently landed transport disconnect tolerance improvements landed upstream in, https://github.com/goodboy/tractor/pull/411 More or less just some changes so we expect `tractor.TransportClosed` throughout various subsystem's IPC disconnect handling. --- ### Summary of tweaks, - `.data._sampling`, include it in the `Sampler.bcast_errors` set. - `.clearing._ems`, include it in the `Router.client_broadcast()` handler's set. - in `.data._web_bs`, this patch additionally adds a `try/except` handler *around* `open_autorecon_ws()` to avoid propagating benign `NoBsWs.recon_errors` caught during full ws-reconnect sequencing.
goodboy added 4 commits 2026-02-23 01:10:35 +00:00
e1f3d7c3f8 Handle `tractor.TransportClosed` as "stream-closed"
In both the ems and sampler since on new `tractor` this is the
"wrapping" exception raised when the transport layer terminates early
but in a psuedo-"graceful" way, expected when a peer actors disconnect.
Previously we were crashing in this case since old `tractor` just raised
the underlying `trio`-source-exceptions verbatim.

Also,
- use `Aid.reprol()` in log msgs vs old `.chan.uid` refs

(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
6f390dc88c Add timeout + shielding to `NoBsWs` reconnect logic
Add timeout param to `.reset()` and `.send_msg()` to prevent
indefinite blocking on reconnect attempts. Shield reconnect
sleeps from cancellation to ensure we avoid any "finally footgun" type
scenarios where `trio.Cancelled` masks an underlying exc per,
- https://github.com/goodboy/tractor/pull/387
- https://github.com/goodboy/tractor/pull/391

Deats,
- add `timeout` param to `.reset()`, return `bool` for success
- add `timeout=3` default to `.send_msg()` for reconnect wait
- shield `.reset()` call in `.send_msg()` error handler
- log warning when reconnect timeout exceeded
- shield throttled sleeps in `_reconnect_forever()` error paths

(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
3d83b61f3f Wrap `open_autorecon_ws()` body for comms failures
Add outer `try/except` around the nursery block in
`open_autorecon_ws()` to catch any `NoBsWs.recon_errors` that
escape the inner reconnect loop, logging a warning instead of
propagating.

Also,
- correct `NoBsWs.recon_errors` typing to `tuple[Type[Exception]]`.

(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
4e24cb1bff Adjust sampler's "IPC-dropped" log msg styling
Refmt the "connection-dropped" error-log in `Sampler`'s broadcast loop
to show error type first, then the IPC context details; mks it all
easier to grok/less-noisy on console imo.

(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
goodboy merged commit 6b70fea5d4 into main 2026-02-23 03:08:19 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: pikers/piker#73
There is no content yet.