Repository navigation
flashnext host: a close with replies queued finishes each one, with no copy of the queue to fail - #2616
Merged
Conversation
…o copy of the queue to fail The run loop's closing path copied the queue, cleared it and finished the copy. When the copy failed for want of memory, the queue was cleared anyway, so no queued reply heard finished and each request thread waited in its mailbox for good. The queue is now taken whole, as the lane host's close does, so the path allocates nothing. A host test arms the allocator to fail at that point and checks every mailbox without blocking.
ashhart
force-pushed
the
lead/fn-host-close
branch
from
November 8, 2026 23:13
e62f984 to
efede6a
Compare
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.
What this changes
When a Flash Next server closes with replies still queued, its run loop copied the queue, cleared it and ended each copied reply as cancelled. If that copy failed for want of memory, the queue was cleared anyway. No queued reply heard
finished, so each request thread waited in its mailbox for good. Shutdown itself stays bounded, but those threads never return. The loop now takes the queue whole, as the lane host'scloseAllincore/lane_host_end.zigdoes, so the close path allocates nothing.atc overlap --json: no open pull request among the 100 most recently updated toucheszig/src/native/flashnext_host.zig, and the branch is on current main.Checks on this head
e62f984a5(8684399cfthe fix and its test,e62f984a5the CHANGELOG line).zig build test-flashnext-driver-hoston macOS, 4 passed, 0 failed, 0 skipped. The new test,a drained Flash Next host finishes every queued reply, even when it cannot copy the queue, arms a failing allocator at the close path's next allocation, then reads every reply's mailbox without blocking. On main it fails (replies left unheard) and does not hang.Receipt
zig/src/native/flashnext_host.zig).52427c023, Zig 0.17.0, macOS on Apple Silicon (Metal), host tests only.Checklist