Uh oh!
There was an error while loading. Please reload this page.
fix(core): resolve child process exit signal on exit event - #42275
Open
vladislav-miroshnikov wants to merge 2 commits into
Open
fix(core): resolve child process exit signal on exit event#42275vladislav-miroshnikov wants to merge 2 commits into
vladislav-miroshnikov wants to merge 2 commits into
Conversation
Contributor
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
6 tasks
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 freeto 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.
Issue for this PR
Fixes#41806
Type of change
What does this PR do?
ChildProcessHandle.exitCodewas settled from Node'scloseevent, which waits for stdio to close after the direct child exits. A descendant that inherits one of those pipes can therefore keep the direct child's exit signal pending.This settles the signal from
exitinstead and retainscloseas a fallback. The change is intentionally limited to the handle lifecycle; callers that separately collect streams continue to wait for stream completion.How did you verify your code works?
cd packages/core && bun test test/effect/cross-spawn-spawner.test.ts— 25 pass, 0 failcd packages/core && bun typecheckThe regression starts a parent that spawns a descendant with inherited stdout, records readiness, and exits. The descendant holds the pipe open until the test releases it, proving that
exitCodesettles from the direct child's exit rather than the later stream close.Screenshots / recordings
N/A — no UI change.
Checklist