Repository navigation
fix(minimald): end the box_actor flakes from the mint seam race and reset hangups - #2649
Merged
Merged
Conversation
Contributor
Contributor
|
Approved: no findings at Nothing to do. Clobber: none seen. |
bryan-minimal
approved these changes
Oct 27, 2026
bryan-minimal
left a comment
Member
There was a problem hiding this comment.
Both diagnoses hold up against the code: aborting the host_ip watcher only asks the loop to abort, so waiting on the mailbox's close is the right seam; and ECONNRESET on a peer that closed with output unread is the same hangup as EOF, which closed_by_peer names once instead of matching rendered text. No bound changed, no assertion changed. This is also the flake that hit #2650's CI yesterday.
norrietaylor
enabled auto-merge
October 27, 2026 18:58
…eset hangups - wait for the host mailbox to close in the mint seam - log a reset connection as closed by its peer
norrietaylor
force-pushed
the
fix/box-actor-flaky-timeouts
branch
from
October 28, 2026 05:40
116bdff to
485b4c5
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.
Summary
Closes #2609
Neither flake was a timeout that was too short. Each had a race behind it, so this PR changes no bound and changes no assertion.
a_mint_whose_host_dies_before_attach_reports_a_spawn_failure(channel did not close within the timeout; got [])Cause: a race in the test seam.
mint_attach_seamseedsHostDiedBeforeAttach. It ends the host it just launched by callinglaunched.1.abort()and awaiting the handle, and only then does the mint's attach send. Since #2570, landed 2026-10-25 (the flakes started the next day), the handle of ahost_ipbox is thewatch_quic443_exitwatcher, not the host loop. Aborting the watcher reaches the loop only throughAbortLoopOnDrop, which asks the loop to abort. So the awaited handle can resolve while the loop still holds its mailbox. The attach send then queues into that mailbox andmint_session_hostreturnsOk(()). The client gets no refusal and its channel never closes. Under load the loop's cancellation loses this race more often.Fix: the seam now also awaits the event the attach depends on, the mailbox closing. It uses a new test-only
HostHandle::closed()that wrapsmpsc::Sender::closed(). TheHostWedgedbranch gets the same wait, so nothing of the real host outlives the swap. No production path awaits an aborted host task and then expects a closed mailbox, so only the seam changes.abrupt_client_loss_keeps_task(10.4 s)Cause: the daemon logged a real hangup under the wrong label. The CI log captured in the failure shows that the loss was logged, but as
WARN ... session ended with error error=Protocol error: Connection reset by peer (os error 104)and not asconnection closed by peer. The test's 10 s wait for that line could never succeed. A client that closes its UDS socket while daemon output (here, the last echo) is still unread in its receive queue makes the daemon's next read fail withECONNRESETand not with an end of file. The accept loop matched onlyearly eof,Broken pipeandDisconnectedin the rendered message, so it logged a routine abrupt hangup as an incident. That also affects field logs, not only the test.Fix: a
closed_by_peerhelper inserver.rsalso reads the io error kind.ConnectionReset,UnexpectedEofandBrokenPipenow count as a peer hangup. The old message matches stay for errors that russh reports as its own. A unit test,server::tests::a_reset_connection_was_closed_by_its_peer, pins the classification.Diff
crates/minimald/src/box_actor.rs: the seam waits onclosed()in both branches.crates/minimald/src/box_runtime/handle.rs: adds the test-onlyHostHandle::closed().crates/minimald/src/server.rs: addsclosed_by_peer, and the accept loop uses it.crates/minimald/src/server/tests.rs: adds the unit test.Testing
Host: Linux x86_64, 4 vCPUs. The load was
stress-ng --cpu 4(--cpu 8where noted). All runs used--retries 0or ran the libtest binary directly.Mint test, under
stress-ng --cpu 4:--exactchannel did not close within the timeout; got []at tests.rs:1660 after 5.9–6.9 scargo nextest run -p minimald --retries 0--exact(same harness as before)Abrupt test:
stress-ng --cpu 4, plus 40 runs as 4 parallel loops of 10 understress-ng --cpu 8. The window is narrow.session ended with error error=Protocol error: Connection reset by peer (os error 104).connection closed by peer, and 8 of those carriedConnection reset by peer (os error 104).cargo nextest run -p minimald --retries 0understress-ng --cpu 4: 30/30 passed (5.54–5.82 s).Suites and gates:
cargo nextest run -p minimald --retries 0: 1139 passed, 18 skipped.just fix: clean.cargo clippy -p minimald --all-targets --locked -- -D warnings: clean.cargo fmt --all -- --check: clean.just clippy-strict: clean.Checklist
connection closed by peerline already exists)BREAKING CHANGE:footer present if this is a breaking change (not a breaking change)Generated by Claude Code
Summary by CodeRabbit