Repository navigation
Task: beside asserts it is not on the frame thread, and the Sans-IO doc says who may call it - #1132
Merged
Merged
Conversation
…oc says who may call it `task::beside` joins its scoped sibling before the caller returns, so the caller waits for the network. That is fine in an IO body a runner already runs off the frame (fetch_full, fetch_source, build_stream) and would stall the frame in a machine step. The `workers` gate is path-scoped and cannot tell a body from a step, and `beside` is deliberately not a ledger line (it is not a detached worker start), so the check is a debug assertion in `beside_with`, the same one `OffFrame::mint` has. A regression test puts the test thread on the frame and expects the panic. The `beside` doc comment now says why the gate does not count it instead of telling callers how to spell the call, and docs/sans-io.md gets one bullet saying who may call it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #956, from the Sans-IO review of
task::beside: it fits as landed (each of its three callers is inside an IO body a runner already runs off the frame), but nothing stopped a machine step from calling it later and blocking the frame on the network.beside/beside_withassert they are not on the frame thread, the samedebug_assert!anOffFramemint has. Free in release builds; catches a step-side call on any tested path.a_beside_request_on_the_frame_thread_is_refused(failed before the assertion, passes after).besidedoc comment now says why theworkersgate does not count it (joined before the body returns) instead of telling callers how to spell it past the gate;docs/sans-io.mdgets one bullet saying the same. No ledger or gate change.Gates
Crate tests on the committed tree:
plx_base232 passed,plx_data1295 passed,plx_mediahostsim 2175 passed;ci/check-deps.shgreen (workers: 7 sites, unchanged). PR CI is the gate.No issue: a review follow-up to #956.
🤖 Generated with Claude Code