-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
child_process: setup stdio on error when possible #27696
Conversation
Is this |
It's a breaking change if code relies on stdio streams NOT being configured when spawn fails with |
CI: https://ci.nodejs.org/job/node-test-pull-request/23114/ EDIT(cjihrig): CI was yellow. |
Ping for reviews. |
Optional suggestion: The current condition is covered in tests. Would be great if you could confirm that this is still covered with the change. |
@Trott both branches of the conditional are still covered. I also pushed up some assertions to verify it. We may miss coverage on the |
// It's kind of silly that the de facto spec for ENOENT (the test suite) | ||
// mandates that stdio _is_ set up, even if there is no process on the | ||
// receiving end, but it is what it is. | ||
if (err !== UV_ENOENT) return err; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh hey, it's that comment's fifth birthday tomorrow - that's long enough for me to change my mind. :-)
CI: https://ci.nodejs.org/job/node-test-pull-request/23229/ EDIT(cjihrig): CI was yellow. |
As more spawn() errors are classified as runtime errors, it's no longer appropriate to only check UV_ENOENT when determining if stdio can be setup. This commit reverses the check to look for EMFILE and ENFILE specifically. PR-URL: nodejs#27696 Fixes: nodejs#26852 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
As more spawn() errors are classified as runtime errors, it's no longer appropriate to only check UV_ENOENT when determining if stdio can be setup. This commit reverses the check to look for EMFILE and ENFILE specifically. PR-URL: #27696 Fixes: #26852 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
As more
spawn()
errors are classified as runtime errors, it's no longer appropriate to only checkUV_ENOENT
when determining if stdio can be setup. This commit reverses the check to look forEMFILE
andENFILE
specifically.Fixes: #26852
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes