Skip to content

fix(mcpx): sdnotify Send fails fast on an undrained socket (#5428) - #9023

Closed
dezren39 wants to merge 1 commit into
mainfrom
queue/9439-5428-sdnotify-deadline
Closed

dezren39 wants to merge 1 commit into
mainfrom
queue/9439-5428-sdnotify-deadline

Conversation

@dezren39

@dezren39 dezren39 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

What

sdnotify.Send dialed and wrote to $NOTIFY_SOCKET with no deadline. In the fleet-build container, a write to the abstract notify socket blocked indefinitely — TestAbstractSocketName hung for the full 1800s test timeout and cascaded into the opencode/openchamber derivation failures in run 41819578987.

Change

  • Send now dials with a 5s net.Dialer timeout and sets a 5s write deadline (writeTimeout), with the reason recorded at the constant: a notify is best-effort daemon bookkeeping and must never wedge startup — an undrained or unresponsive socket now produces an error in seconds.
  • Regression test TestSendFailsFastWhenTheSocketIsNotDrained: fills a bound listener's receive queue with unread datagrams, then calls Ready under a 20s watchdog. An error is the pass (fail-fast); exceeding the watchdog is the failure (the old hang). On kernels where a fresh sender's datagram is delivered despite the full queue — verified on the laptop kernel, where a fresh connection's write succeeds while an established sender blocks and its deadline fires — the blocking path cannot be exercised and the test skips with that reason stated, per the issue's own fix direction (skip or fail fast with a clear reason, never hang).

Verification

  • go vet ./internal/sdnotify/ clean.
  • go test ./internal/sdnotify/ -count=1: the four existing tests pass; the new test skips on the laptop kernel with the reason above (the deadline mechanism itself was verified directly: an established sender to a full queue blocks and its write deadline fires with i/o timeout).

Closes #5428.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Dial and write deadlines (5s) so a notify can never wedge startup or a test for the full timeout; regression test fills the receive queue and watchdogs Ready, skipping with a stated reason on kernels where a fresh sender cannot be made to block.
@dezren39
dezren39 requested a review from a team as a code owner November 12, 2026 20:47
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 95fb20b7-acae-4dc4-9bb9-4d2161ea9928
Commits

Reviewing files that changed from the base of the PR and between d7ad9d0 and 8e36c71.

Files selected for processing: 2

  • pkgs/mcpx/internal/sdnotify/sdnotify.go
  • pkgs/mcpx/internal/sdnotify/sdnotify_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T20:49:08.751188Z 8e36c71 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39

Copy link
Copy Markdown
Member Author

Agent note — task 17188 claimed by lane any-d (PR shepherd pass)

@dezren39

Copy link
Copy Markdown
Member Author

Agent note — task 17188 closing PR #9023 as SUPERSEDED (landed via PR #6176)

  • state: done (superseded) — this PR is being closed, not merged
  • Evidence the change is already on main:
  • Salvage check (this branch diffed against main, per protocol — not a file-list comparison):
    • Implementation: this branch is a simpler variant of the landed fix (5s writeTimeout const, plain net.Dialer{Timeout}, no context dial, no dialer seam, loses the "set write deadline" error context). Nothing in it improves on main; merging it would regress the landed structure.
    • Test: the branch's one addition, TestSendFailsFastWhenTheSocketIsNotDrained (real undrained-socket watchdog), covers the same dial/write-deadline invariant main already pins via the seam — and by its own write-up it skips on the laptop kernel, where a fresh sender's write succeeds. Nothing unique to port.
    • Conclusion: nothing unique — no salvage needed.
  • The failing checks on this head (lint, mcpx-test unit/e2e shards, plugin sync, ci-ok) are moot: they ran 2026-11-12 on a stale base for a change that landed through fix(mcpx): bound sdnotify socket sends #6176 the next day; they are not a reason to keep or merge this duplicate.
  • Codex review on this head completed with no findings; no held labels at any point.
  • Outcome recorded for task 17188 as superseded; the canonical fix is PR fix(mcpx): bound sdnotify socket sends #6176 / commit 93707be on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main CI failure: org-run (generic dispatch runner) (run 41819578987)

1 participant