Skip to content

fix(mcpx/sdnotify): bound the whole send by its context — the fd deadline can wedge (#17255) - #17350

Merged
developing-today-fleet[bot] merged 3 commits into
mainfrom
xaltha/0900az-17255-sdnotify
Nov 30, 2026
Merged

developing-today-fleet[bot] merged 3 commits into
mainfrom
xaltha/0900az-17255-sdnotify

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #17255

Diagnosis

The mcpx derivation's check phase burned its full 30m per-package timeout on internal/sdnotify in runs 46402268282 and 46446099299. Reproduced in the real nix sandbox under the full check phase with the timeout temporarily capped at 4m (run 46464355930) to capture the dump:

  • panic: test timed out — running tests: TestAbstractSocketName
  • The only interesting goroutine is in state [syscall]: syscall.Syscall(0x1, fd 8, buf, 7) — the 7-byte READY=1 write — via internal/poll.(*FD).Write (fd_unix.go:379 → ignoringEINTRIO, fd_unix.go:743) ← sdnotify.sendWithDialer (sdnotify.go:43) ← Send ← Ready ← TestAbstractSocketName.
  • The dump contains no netpoller goroutine: the dialed unixgram fd was in blocking mode, so the raw write(2) parked in the kernel and the 1s write deadline — a netpoller mechanism — never fired. The same package passes in 0.027s standalone (plain runner run 46460400914; isolated sandbox run 46461963216), so the wedge is a property of the fd the full-phase context hands the dial, not of any single test's logic.

Fix — bound the send, not just the fd

sendWithDialer now runs the dial+write (sendBlocking) on its own goroutine and selects on the send context, so Send always returns by its timeout with the context's deadline error, whatever mode the fd is in. That error is a net.Error timeout, which TestAbstractSocketName already classifies via abstractSocketUnavailable — in a wedged sandbox the abstract test now skips after ~1s instead of burning the package budget. The daemon's startup notify (cli/root.go Ready/MainPID) gets the same guarantee: a wedged notify socket can no longer hold daemon startup.

Regression test (failing-first, per the mcpx test doctrine): TestSendCannotWedgePastItsTimeout — a conn whose Write never returns, modelling the dump; oracle: sendWithDialer returns context.DeadlineExceeded promptly. It hangs on the pre-fix code.

Verification

The branch also contains the diagnostic 4m-timeout commit and its revert (used to capture the dump); net effect on package.nix is zero.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-30T17:18:58Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch/workspace/github-work/code-17255-az",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch/workspace/github-work/code-17255-az",
      "repo": "developing-today/code",
      "branch": "xaltha/0900az-17255-sdnotify",
      "sha": "c25a6d1cf75a7035c0d2bbf58cbe0281e95af167"
    },
    "auth_subject": "xaltha",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

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

…eadline

TestAbstractSocketName hung the mcpx derivation's check phase for the
full per-package timeout (30m in production, runs 46402268282 and
46446099299): the goroutine dump (reproduced in-sandbox with a 4m cap,
run 46464355930) shows the 7-byte READY=1 write parked in the kernel
in internal/poll.(*FD).Write with no netpoller goroutine in the
process — the dialed fd was in blocking mode, so the 1s write
deadline, a netpoller mechanism, never fired.

sendWithDialer now runs the dial+write on its own goroutine and
selects on the send context, so Send always returns by its timeout
with the context's deadline error (which TestAbstractSocketName
already classifies as abstract-sockets-unavailable and skips).
Regression test: a conn whose Write never returns must not hold the
send past its timeout.

Closes #17255
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

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: 427998d4-91ee-4d50-83bf-c00967240cbf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

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.

mcpx derivation check fails: internal/sdnotify test hangs to 1800s timeout — blocks pkgs/fleet nix dev shell

1 participant