stop_is_oec: expect trio.EndOfChannel as graceful stream shutdown #37

Open
goodboy wants to merge 5 commits from stop_is_oec into jsonrpc_err_in_rent

This should likely be synced with tractor’s new typed-IPC-msging either via dev branch or (ideally) a release!


Change .data._sampling broadcast error handling to include trio.EndOfChannel in the Sampler.bcast_errors: set since a tractor.MsgStream termination msg (Stop) now instead translates to that raised in task.

The main purpose here is to avoid crashing the sampler broadcast task in such graceful peer-disconnect conditions.

This should likely be synced with `tractor`'s new [typed-IPC-msging](https://pikers.dev/goodboy/tractor/pulls/7) either via dev branch or (ideally) a release! --- Change `.data._sampling` broadcast error handling to include `trio.EndOfChannel` in the `Sampler.bcast_errors: set` since a `tractor.MsgStream` termination msg (`Stop`) now instead translates to that raised in task. The main purpose here is to avoid crashing the sampler broadcast task in such graceful peer-disconnect conditions.
goodboy added 3 commits 2025-02-20 16:32:25 +00:00
6e495511ff Suppress `trio.EndOfChannel`s raised by remote peer
Since now `tractor` will raise this native `trio`-exc translated from
a `Stop` msg when the peer gracefully terminates a `tractor.MsgStream`.
Just `info()` log in such cases versus continuing to warn for the
others.
a795108041 Group bcast errors as `Sampler.bcast_errors`
A new class var `tuple[Exception]` such that the err set can be reffed
externally as needed for catching other similar pub-sub/IPC failures in
other (related) real-time sub-systems.

Also added some now-masked logging for debugging live-feed stream reading
issues that should ONLY be used for debugging since they'll greatly
degrade HFT perf. Used the new `log.mk_repr()` stuff (that one day we
should prolly pull from `modden` as a dep) for pretty console emissions.
389c746223 Catch using `Sampler.bcast_errors` where possible
In all other possible IPC disconnect handling blocks. Also more
comprehensive typing throughout `uniform_rate_send()`.
goodboy force-pushed stop_is_oec from 389c746223 to 49841f5b91 2025-02-21 21:25:07 +00:00 Compare
goodboy changed title from stop_is_oec: expect `trio.EndOfChannel` as grace stream shutdown to stop_is_oec: expect `trio.EndOfChannel` as graceful stream shutdown 2025-02-21 22:12:33 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b stop_is_oec jsonrpc_err_in_rent
git pull origin stop_is_oec

Step 2:

Merge the changes and update on Gitea.
git checkout jsonrpc_err_in_rent
git merge --no-ff stop_is_oec
git push origin jsonrpc_err_in_rent
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#37
There is no content yet.