Repository navigation
fix(supervisor): service-child anchors abort on Node 26 when stdin is /dev/null - #187803
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR uses the shared stdin-release helper at both service-child anchor retirement points to preserve file-backed fd 0 on Node 26. Example: A Node 26.12.1 anchor starts with /dev/null stdin and performs a synchronous spawn during retirement.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes a remaining stdin-retirement hazard on main with a focused change and a meaningful regression test; no actionable patch defects were found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe process supervisor launches an anchor that relays child input and output, observes descendant cleanup, and reports retirement over a private control channel. flowchart TD
A[Supervisor host] --> B[Service child anchor]
B --> C[Command process]
C --> D[Cleanup and closing receipt]
D --> E[Shared stdin release]
E --> F[Natural anchor exit]
Technical reviewBest possible solution: Use the existing fd-type-aware stdin owner at both anchor release points while preserving the current retirement protocol. Do we have a high-confidence way to reproduce the issue? The added real-process regression supplies /dev/null stdin and a synchronous spawn after retirement, and the body records the intended Node 26 red/green result; this read-only review did not execute it. Is this the best way to solve the issue? This is the smallest complete fix: both release sites use the existing fd-type decision owner, with no new state, compatibility path, or production test seam. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e64008c7a90d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +42. Total +43 across 2 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 29, 2026, 1:19 PM ET / 17:19 UTC. |
Backport #187803 from 1840456. Reuse the existing releaseProcessStdin owner from a3dd92b rather than duplicating fd-type policy. Node 26.12.1 regression: SIGABRT on the base, clean exit after the fix. All 17 anchor retirement cases and 5 stdin helper cases pass. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit a83c3874fa3d42ff29df15bc116d233fa2385b9c)
Related: #187516
What Problem This Solves
Fixes: on Node 26, a service-child group anchor whose stdin is
/dev/nullor a regular file can abort with SIGABRT during retirement, before it sends its closing receipt.User Impact
User impact: service-child anchors retire cleanly on Node 26 whatever their stdin is. In the Gateway's production launch path, anchors get a pipe as stdin whenever input is relayed, so no Gateway failure has been observed. This removes a latent abort and fixes a Node 26-only test failure on
release/2026.10.10.Why This Change Was Made
Node 26 closes fd 0 when it destroys a stdin
fs.ReadStreamover/dev/nullor a file. The next libuv handle can then be given fd 0, and libuv'suv__closeassertsfd > STDERR_FILENOwhen it closes that handle. The anchor still calledprocess.stdin.destroy()infinish()and instopInput(). Both calls now usereleaseProcessStdin(), the owner added in #187516. It leaves file-backed stdin open and still releases pipes, sockets and TTYs.On
release/2026.10.10, the macOS process census still runsspawnSync("/bin/ps")afterstopInput(). When the test fixture spawns the anchor withstdio[0]: "ignore", the anchor aborts insideSyncProcessRunner::CloseHandlesAndDeleteLoop -> uv__close. On main the failure doesn't show because the macOS census became native in #175368, which removed that sync spawn. The anchor hazard is still on main.Evidence
keeps /dev/null stdin on fd 0 through retirement. It starts an anchor with/dev/nullstdin, and a preload runsspawnSyncatbeforeExit.expected { code: null, signal: 'SIGABRT' } to deeply equal { code: 0, signal: null }pnpm teston the anchor retirement, input-lifetime, deadline and preparation tests plusrelease-stdin.test.ts: 37/37 pass on Node 26.12.1 and on Node 24.22.1.pnpm check:changed: typecheck, lint and format pass. The dead-export scan fails on main on unrelated files (scribes-state.ts,delivery-queue-storage.ts,session-delivery-queue-storage.ts,schtasks...test-support.ts,gateway-restart.test-support.ts). This diff doesn't touch them.abort <- __assert_rtn <- uv__close <- uv__loop_close <- node::SyncProcessRunner::CloseHandlesAndDeleteLoop.