8000 fix: tolerate the macOS lost-race write error in the control-cap test by gominimal-aw-bot[bot] · Pull Request #2875 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix: tolerate the macOS lost-race write error in the control-cap test - #2875

Merged
norrietaylor merged 1 commit into
mainfrom
inbox-patch/control-cap-lost-race-error-kinds-e30df7522245e595
Nov 4, 2026
Merged

norrietaylor merged 1 commit into
mainfrom
inbox-patch/control-cap-lost-race-error-kinds-e30df7522245e595

Conversation

@gominimal-aw-bot
@gominimal-aw-bot gominimal-aw-bot Bot commented Nov 3, 2026 •
Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABcQ_m_Q

Past the control door's connection cap, accept_loop writes the refusal
and closes the connection without reading the request line. A client
that writes anyway can lose the race to that close. The
control_connections_refused_past_the_cap test asserted the lost write
always fails with ErrorKind::BrokenPipe, which is what Linux reports
(EPIPE). On macOS the same lost race fails with ENOTCONN
(ErrorKind::NotConnected), so a correctly-refused connection failed
the test. The unit suite on the macOS lane intermittently showed this.

Accept NotConnected beside BrokenPipe in the lost-race assertion,
and name both platform outcomes in the race comment. ConnectionReset
is not added: it is a TCP errno, not a unix-domain-socket write error,
so it cannot surface on this path. The door's refusal logic is
unchanged.

Verification

cargo fmt --all --check --manifest-path target/Cargo.toml — clean
cargo clippy --workspace --all-targets --locked --manifest-path target/Cargo.toml -- -D warnings — clean, finished in 1m 49s
cargo test --locked --manifest-path target/Cargo.toml -p minvmd control:: — 66 passed; 0 failed (includes control_connections_refused_past_the_cap)
cargo test --locked --manifest-path target/Cargo.toml -p minvmd — 661 passed; 0 failed, with 4 failures reproduced identically on unmodified main (sandbox-environment path/mode and tracer issues, unrelated files)
live-session: macos e2e (ci-macos.yml) — crates/minvmd/** matches the lane's on patterns, so the lane runs on this PR; the macOS-only write-race errno itself is not reproducible on this Linux runner and is exercised by the unit test on the macOS unit lane

Summary by CodeRabbit

  • Tests
    • Updated connection-limit validation to accept the differing error responses returned by Linux and macOS when writing to a connection that was refused before its request was read. This keeps the test’s expected behavior aligned with platform-specific connection handling; no user-facing functionality has changed.

Past the control door's connection cap the accept loop closes a
connection without reading it, so a client's write can lose the race
to that close. The test asserted the lost write always surfaces as a
broken pipe, but on macOS the same lost race fails with ENOTCONN
instead, so a correctly-refused connection failed the test.

Accept NotConnected beside BrokenPipe for the lost-race write, and
name both platform outcomes in the race comment. The door's refusal
logic is unchanged.
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner November 3, 2026 22:35
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Nov 3, 2026
@coderabbitai
coderabbitai Bot commented Nov 3, 2026 •
Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The control-connection cap test now accepts either BrokenPipe or NotConnected when writing to a connection refused before its request is read. Its comment describes the platform difference.

Changes: Control connection cap test

Layer / File(s) Summary
Platform-specific write error assertion
crates/minvmd/src/control.rs
The test accepts BrokenPipe or NotConnected for the refused connection. The comment distinguishes Linux and macOS behavior.

Estimated code review effort: 2 (Simple) | ~5 minutes

Suggested reviewers: norrietaylor

Merge Risk: Minimal · up to ed412

No merge-blocking issue remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title is a Conventional Commit subject that names the main change: the control-cap test now tolerates the macOS lost-race write error. It matches the summary, which accepts NotConnected alongside …
Description check Passed The description covers the problem, the cause, the code change, and why ConnectionReset was not added. It includes a Verification section with the commands run and their results, which satisfies the t…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title is a Conventional Commit subject that names the main change: the control-cap test now tolerates the macOS lost-race write error. It matches the summary, which accepts NotConnected alongside BrokenPipe in the lost-race assertion. The title is specific and short, and it follows the repository's type(scope): summary format closely enough. Minor note: the template asks for a scope, and this title has none, but the title still clearly reflects the change.

Full details: Description check

Explanation

The description covers the problem, the cause, the code change, and why ConnectionReset was not added. It includes a Verification section with the commands run and their results, which satisfies the template's Testing section. The Summary section does not link an issue with Refs or Closes. It uses a Routing-Key line instead, and the template asks for a Summary with issue links where related. The Checklist from the template is absent: it has no item on docs updated and no BREAKING CHANGE footer check. These gaps are minor, so the description is mostly complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the pipe,
The test now knows two signs,
Broken or not connected,
Both fit the platform lines.
The cap test hops along,
With errors neatly aligned.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: db3e92f8-ab01-4263-8985-5b1a22c0be09
Commits

Reviewing files that changed from the base of the PR and between df86453 and ed41220.

Files selected for processing: 1
  • crates/minvmd/src/control.rs

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@gominimal-aw-bot gominimal-aw-bot Bot added the agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch label Nov 3, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Nov 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 4, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 7e65a84 Nov 4, 2026
34 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/control-cap-lost-race-error-kinds-e30df7522245e595 branch November 4, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0