8000 fix(minimal): retry a refused daemon socket connect in the ssh proxy command by gominimal-aw-bot[bot] · Pull Request #1919 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minimal): retry a refused daemon socket connect in the ssh proxy command - #1919

Merged
norrietaylor merged 4 commits into
mainfrom
inbox-patch/839-proxy-connect-retry-d9d7280754ced98b
Oct 4, 2026
Merged

norrietaylor merged 4 commits into
mainfrom
inbox-patch/839-proxy-connect-retry-d9d7280754ced98b

Conversation

@gominimal-aw-bot
@gominimal-aw-bot gominimal-aw-bot Bot commented Oct 4, 2026 •
Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABU1Jl2A

Defect

min proxy --socket <sock> (the SSH ProxyCommand) connects to the daemon UDS once with no retry. A burst of concurrent min session exec invocations can overflow the daemon accept backlog, so the proxy fails spuriously with ECONNREFUSED.

Change

Retry the connect a bounded number of times (20, 100ms apart) on ConnectionRefused only. A NotFound (no socket file) still fails immediately, so a proxy against a daemon that is not running does not hang for the retry window. Reuses the client crate retry constants by making them pub.

Verification

  • cargo fmt --all --check passes
  • cargo clippy -p minimal -p minimal-client --all-targets --locked --no-deps -- -D warnings passes
  • cargo build -p minimal --locked passes
  • cargo test -p minimal --locked connect_with_retry passes (2/2)

Note: workspace-wide clippy and one unrelated lib test (legacy_network_spellings_parse_with_hint) fail on this checkout due to a pre-existing toolchain mismatch (stable 1.99.0 vs pinned 1.97.0) and are untouched by this change.

Summary by CodeRabbit

  • Bug Fixes
    • Admin proxy connections now retry temporary connection refusals and unavailable-socket conditions, with up to 20 attempts spaced 100 ms apart. This can help connections succeed when the listener starts shortly after the proxy attempts to connect.
    • Missing sockets and other non-retryable connection errors still fail immediately. If all attempts fail, the error includes the socket path for easier troubleshooting.

…command

A burst of concurrent `min session exec` invocations can overflow the
daemon's accept backlog, so the proxy's single connect attempt fails
spuriously with ECONNREFUSED. Retry the connect a bounded number of
times (20, 100ms apart) on ConnectionRefused only; a NotFound (no
socket file) still fails immediately so a proxy against a daemon that
is not running does not hang for the retry window.
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner October 4, 2026 00:24
@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 Oct 4, 2026
@coderabbitai
coderabbitai Bot commented Oct 4, 2026 •
Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: f8266f16-3b0a-4a93-8a8c-7d56df5df0e4
📥 Commits

Reviewing files that changed from the base of the PR and between 2294368 and 0723550.

📒 Files selected for processing (1)
  • crates/minimal/src/cmd/admin.rs

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The proxy command now retries Unix-socket connections that return ConnectionRefused or WouldBlock. The retry count and delay are public constants. Tests cover retry success, missing sockets, and WouldBlock.

Changes

Proxy connection retry

Layer / File(s) Summary
Retry policy and proxy connection
crates/minimal-client/src/lib.rs, crates/minimal/src/cmd/admin.rs
CONNECT_RETRIES and CONNECT_RETRY_DELAY are public. cmd_proxy uses connect_with_retry, which retries ConnectionRefused and WouldBlock errors and returns other errors immediately with socket-path context. Tests cover a late listener, a missing socket, and WouldBlock on Linux.

Priority: ➖ Normal

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

Change: Bug fix

Suggested reviewers: 0chroma

Merge Risk: ⚪ Minimal · up to 07235

The change makes the SSH proxy connection to the daemon more resilient to a full accept backlog. No merge-blocking risk was identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: retrying a refused daemon socket connection in the SSH proxy command. It is concise and follows the repository’s Conventional Commit format.
Description check ✅ Passed The description explains the defect, the change, and the verification performed. It omits the template’s Summary and Checklist headings, but the required change rationale and testing details are prese…
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. Analyzed 7 functions across 2 files.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit waits beside the door
The socket knocks, then knocks once more
A listener wakes; the stream runs through
A missing path ends waiting too
The rabbit hops, with retries done
And leaves the code beneath the sun

Comment @coderabbitai help to get the list of available commands.

@gominimal-aw-bot gominimal-aw-bot Bot added the agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch label Oct 4, 2026
@norrietaylor norrietaylor changed the title fix: fix(minimal): retry a refused daemon socket connect in the ssh proxy command fix(minimal): retry a refused daemon socket connect in the ssh proxy command Oct 4, 2026
A non-blocking AF_UNIX connect against a full accept backlog fails with
EAGAIN (WouldBlock) on Linux, not ECONNREFUSED, so the proxy retry never
fired there. Retry both kinds.
…he socket path

Assert the missing-socket error names the socket path, not just the
'connect to' prefix, and add a Linux-only test that fills a zero accept
backlog until a connect would block, then drains it and checks that
connect_with_retry still reaches the listener.
@norrietaylor
Copy link
Copy Markdown
Member

/review

@minimal-foundry
minimal-foundry Bot commented Oct 4, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at 0723550219c6.

Nothing to do.

Clobber: none: git log on admin.rs and lib.rs shows the four commits are this PR's own progression, no recent fix reverted.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 4, 2026
@norrietaylor
A3EA norrietaylor added this pull request to the merge queue Oct 4, 2026
Merged via the queue into main with commit 27cf68b Oct 4, 2026
34 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/839-proxy-connect-retry-d9d7280754ced98b branch October 4, 2026 20:10
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 review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0