Repository navigation
fix(mcpx/sdnotify): bound the whole send by its context — the fd deadline can wedge (#17255) - #17350
Merged
Merged
Conversation
…ot merge" This reverts commit 6a39e08.
…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
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
This was referenced Nov 30, 2026
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.
Closes #17255
Diagnosis
The mcpx derivation's check phase burned its full 30m per-package timeout on
internal/sdnotifyin 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: TestAbstractSocketNamesyscall.Syscall(0x1, fd 8, buf, 7)— the 7-byteREADY=1write — viainternal/poll.(*FD).Write(fd_unix.go:379 →ignoringEINTRIO, fd_unix.go:743) ←sdnotify.sendWithDialer(sdnotify.go:43) ←Send←Ready←TestAbstractSocketName.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
sendWithDialernow runs the dial+write (sendBlocking) on its own goroutine and selects on the send context, soSendalways returns by its timeout with the context's deadline error, whatever mode the fd is in. That error is anet.Errortimeout, whichTestAbstractSocketNamealready classifies viaabstractSocketUnavailable— in a wedged sandbox the abstract test now skips after ~1s instead of burning the package budget. The daemon's startup notify (cli/root.goReady/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 whoseWritenever returns, modelling the dump; oracle:sendWithDialerreturnscontext.DeadlineExceededpromptly. It hangs on the pre-fix code.Verification
go vetclean; package tests all pass including the new test (0.02s);-race -shuffle=on -count=5clean.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-botwith what you need.