Repository navigation
fix: stderr is complete when a command completes, including after a deadline - #40
Conversation
Covers #9. A Node child whose stderr arrives after its exit event, settlement once across error, exit and close, the shared ProcessDeadline contract on Node and Web stream views, and a real-process stress run of concurrent short failures. Only the deadline case fails: after a timeout the completion resolves before the killed child's pipes have closed. Refs #9
ProcessDeadline already waited for both pipes to end before resolving a normal completion, so stderr was complete when exitPromise resolved on Node, Bun and Deno. After a deadline it resolved on the leader's exit alone, while the pipes it had just released could still be closing. It now waits for each released pipe to close too, which releasing makes certain, and still reports timedOut: true. Documents that stderr must be complete when exitPromise resolves. Closes #9
|
Warning Review limit reachedYou'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 59 minutes. View limit details
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. |
Reviewed VERDICT: CHANGES_REQUIRED |
Footprint5 files, +346/-6 · Structural, as
Compositionpie showData
title Changed lines by file kind
"source" : 19
"test" : 325
"docs" : 8
Files (5)docs
source
test
Figures computed from Before merge
After mergeNo landing steps are declared: After-merge steps are read from this repository's own Blast radius+0 added / -0 removed / ~0 signature-changed exported symbols ·
Exported symbols from Call sites are footprint's own whole-word identifier scan, not graft's: every whole-word occurrence of the name in the tracked, non-binary files of the working tree ( The grouping. A system is the first path segment of a call site's repository-relative path: the directory immediately under the repository root, however deep the file sits inside it. A file at the repository root has no such segment and is grouped under (unassigned), which is listed last and never dropped. Systems are ordered by name so the grouping follows the tree rather than the order the scan found the sites in. The mitigations. Every row's mitigation is derived from two reported facts about that call site and nothing else: whether it is in the very file the symbol is exported from, and what classify() calls that file. A call site in the symbol's own declaring file, or in a test file, is "None needed"; any other call site states the system it is in, or that it is outside every known system. No mitigation is a judgement about importance, risk or coverage, and none is advice: footprint reports and does not judge (AGENTS.md). Every changed source file was in a language footprint recognises graft's grammars can parse. Open pull requestsNo other pull request is open, so nothing can overlap this change. Proposed merge order (1 wave)Wave 1 — #40 No two open pull requests change the same file, so they can land in any order. Pull requests from Changelog
|
|
Response to automated review round 1 R1 (P2, locale): accepted, fixed. The git stress case now passes R2 (P2, unbounded |
The runner passes LANG and LC_* through, so a host with git translations would return a translated, complete message and fail the exact match. Refs #9
|
Correction to my R2 rebuttal: |
The expected text no longer depends on how git discovers a repository from the temporary directory (a tmpfs mount changes the message). A failing read in a fresh repository takes no lock, so every concurrent failure must match the stderr of one run alone. Refs #9
Reviewed 🎬 plumbing review 🟡 100% (1/1) [plumbing:🟡] VERDICT: CHANGES_REQUIRED |
|
Response to automated review round 2 R3 (P2, git diagnostic depends on tmpdir filesystem): accepted, fixed. The git stress case now runs |
|
No findings requiring changes in The deadline path now waits for the leader’s exit and both output The added tests cover late stderr for commands and sessions, competing process events, delayed pipe closure after a deadline, Node and Web stream completion, and concurrent subprocess failures. R1 and R3 are addressed by the locale override and fresh-repository baseline. I found no new argument for reopening R2. The documentation and CHANGELOG match the changed behavior. Review was static. I did not run the test suite. 🎬 plumbing review 🟢 100% (1/1) [plumbing:🟢] VERDICT: APPROVE |
Closes #9
What was already fixed on main
#30 made every runner (Node, Bun, Deno) complete through
ProcessDeadline.settle, which waits for the leader's exit and for both output pipes to end, and each runner then awaits its stderr collector. So on main a normal completion already returns complete stderr even when Node delivers it afterexit. The new tests prove this and stay as regression guards.What this PR changes
After a deadline,
ProcessDeadline.settleresolved on the leader's exit alone, while the pipes it had just released could still be closing. It now also waits for each released pipe'sdrained, which releasing makes certain (a helper holding the other end cannot hold it), and still reportstimedOut: true.Tests (
test/StderrCompleteness.test.js, also wired into the Deno entry)exitand beforecloseis complete, forrun()andopen(). Passed on main.errorthenexit/close;exitthen a lateerror. Passed on main.timedOut: true. Failed on main (expected 1 to be +0: it settled at exit).StoppableNodeStream(Node) andStoppableWebStream(Bun, Deno):settledoes not resolve until late stderr has ended. Passed on main; fails ifsettlestops waiting fordrained(mutation checked).git rev-parsefailures outside a repository, and 4 rounds of 32shchildren writing 8 KiB to stderr just beforeexit 128. Stderr must match exactly.Docs:
docs/CUSTOM_RUNNERS.mdnow states that stderr must be complete whenexitPromiseresolves. CHANGELOG entry under Unreleased / Fixed.