Repository navigation
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Include remaining effect custody in the existing pending-close trace so shutdown stalls remain attributable after their sources settle. Preserve cancellation and retained-write settlement behavior.
Reap adopted exits on SIGCHLD without consuming the tracked root wait status. This breaks a nested-supervision shutdown cycle where the Gateway broker waits for a zombie process group and the outer subreaper waits for the Gateway to exit.
799727c to
a2318f9
Compare
|
Codex review: needs maintainer review before merge. What this changesReap adopted Linux children while the supervised root remains alive and expose retained session effects in shutdown diagnostics. Example: A supervised Gateway receives managed SIGTERM with twelve active runs and real Git child work.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR addresses a current Linux supervision deadlock through the existing process owner, with no actionable introduced defect found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe dedicated Linux supervisor owns adopted child waits beneath the Gateway; session lifecycle owners separately expose retained cleanup work to the Gateway shutdown trace. flowchart TD
A[Managed SIGTERM] --> B[Gateway shutdown]
B --> C[Session cancellation and settlement]
C --> D[Pending close diagnostics]
B --> E[Dedicated Linux supervisor]
F[Adopted child exit] --> E
E --> G[Native wait inspection and reaping]
G --> H[Verified descendant extinction]
Technical reviewBest possible solution: Use the existing dedicated Linux owner to reap adopted exits during root lifetime while preserving runtime-owned statuses and final extinction checks. Do we have a high-confidence way to reproduce the issue? Current main lacks active adopted-child reaping, and the committed native scenario isolates the resulting live-root dependency cycle; the author reports baseline failure and fixed-owner success, which this read-only review did not rerun. Is this the best way to solve the issue? The patch fixes the lifecycle owner directly, preserves its kernel and runtime ownership contracts, and adds diagnostics through the existing bounded trace without introducing a competing cleanup path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2f7572ad13d1. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +33, Tests +81, Docs +8. Total +122 across 8 files. Added test files: 0. View PR surface stats
Review metrics
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 20, 2026, 5:45 PM ET / 21:45 UTC. |
…law#178786) * fix(gateway): identify session effects blocking shutdown Include remaining effect custody in the existing pending-close trace so shutdown stalls remain attributable after their sources settle. Preserve cancellation and retained-write settlement behavior. * fix(process): reap adopted children while supervised roots are active Reap adopted exits on SIGCHLD without consuming the tracked root wait status. This breaks a nested-supervision shutdown cycle where the Gateway broker waits for a zombie process group and the outer subreaper waits for the Gateway to exit. * test(gateway): cover twelve active runs during restart
What Problem This Solves
Fixes Linux Gateway shutdown failing with
ERR_SPAWN_BROKER_UNAVAILABLEwhen an outer process supervisor retains an adopted zombie while the Gateway waits for that child's process group to disappear.User Impact
Gateways running under nested process supervision can complete child cleanup and exit successfully. The mixed regression now covers twelve active runs and requires a clean exit within five seconds of managed SIGTERM.
The separately reported 84-second
session-effectsstall was not reproduced and is not claimed fixed. Pending-close diagnostics now identify remaining effect custody to make a recurrence attributable.Why This Change Was Made
The Linux subreaper previously reaped adopted children only during final cleanup, after its application root exited. A synthetic Gateway reproduction proved a Git zombie belonged to the outer supervisor while the Gateway's spawn broker was waiting for its process group to disappear.
Observe
SIGCHLDafter admitting the root and reuse the existing native drain to reap adopted exits immediately. Tracked root statuses remain owned by Node, and final cleanup still requires authoritative extinction. The effect diagnostic projects existing owners into the existing bounded trace without changing their release barrier.Production code grows by 33 lines for the missing active reaping and owner diagnostics. The existing native and mixed-workload fixtures cover both invariants; no new test file is added.
Evidence
On an isolated Linux sandbox with synthetic data, Node 26.8.2, baseline
8f0973e37405:These are observed functional-test timings, not a performance benchmark. The workload includes held provider streams, nested delivery, subagents, a parent lifecycle wake, real exec/Git child work, and interrupted provisioning.
test/gateway-restart-abort-settlement.e2e.test.ts: passed, including the under-five-second and child-extinction assertions.src/gateway/server-close.test.ts: all 63 tests passed. Its diagnostic regression was red before the trace change and green afterward, while retained writes continued blocking close.Coverage gaps: no code-mode-specific or cron-nested workload in this fixture; no production restart performed; the original 84-second retained-effect owner remains unidentified. The runtime proof used baseline plus the subreaper fix; the additional trace-only change has focused close-handler coverage.