Repository navigation
Conversation
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.
When an inherited-stdio lifecycle script cannot start its configured shell, the child emits
errorandclosewithoutexit. The signal manager only cleans up onexit, so a caughtENOENTleaves the failed child and the SIGINT/SIGTERM forwarding listeners installed. On POSIX, a long-lived caller then loses the default termination behavior for these signals.Keep the existing immediate cleanup on
exit, and also clean up onclosefor failed spawns. Remove both per-child listeners when either event fires so cleanup happens once. Add a real missing-executable regression and a control showing that another running child keeps its forwarding listeners until it exits.Validation:
runScript()call with a nonexistentscriptShellandstdio: 'inherit'rejects withENOENTboth before and after. Before the fix it leaves both signal handlers installed; after the fix neither remains once the child closes.npm testfails only at the finaltemplate-oss-checkfor five generated.githubfiles. Untouched upstream2385917produces identical template-check output with the same dependencies. Generated files are unchanged.An independent Codex agent reviewed the diff and verified normal exits, failed spawns, overlapping children, later batches, and non-terminating errors.
Authored, tested, and independently reviewed using Codex. The account owner authorized this submission but has not personally reviewed or run the change. Local verification was on macOS; native Linux/Windows results remain for CI.
References
Node.js child-process events document that a failed spawn emits
closeaftererror, whileexitis not guaranteed after an error.