Skip to content

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented May 14, 2019

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.

Fixes: #26852

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-github-bot added the child_process Issues and PRs related to the child_process subsystem. label May 14, 2019
@Fishrock123
Copy link
Contributor

Is this semver-major?

@cjihrig
Copy link
Contributor Author

cjihrig commented May 14, 2019

It's a breaking change if code relies on stdio streams NOT being configured when spawn fails with UV_EACCES or UV_EAGAIN. My guess is that it's not a breaking change in the real world.

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented May 14, 2019

CI: https://ci.nodejs.org/job/node-test-pull-request/23114/

EDIT(cjihrig): CI was yellow.

@cjihrig
Copy link
Contributor Author

cjihrig commented May 16, 2019

Ping for reviews.

@Trott
Copy link
Member

Trott commented May 17, 2019

Optional suggestion: The current condition is covered in tests. Would be great if you could confirm that this is still covered with the change.

@cjihrig
Copy link
Contributor Author

cjihrig commented May 18, 2019

@Trott both branches of the conditional are still covered. I also pushed up some assertions to verify it. We may miss coverage on the ENFILE check, but EMFILE is covered.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

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. :-)

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented May 20, 2019

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 <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
@cjihrig cjihrig merged commit 64182e9 into nodejs:master May 20, 2019
@cjihrig cjihrig deleted the 26852 branch May 20, 2019 13:35
BridgeAR pushed a commit that referenced this pull request May 21, 2019
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 <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
@BridgeAR BridgeAR mentioned this pull request May 21, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No error was thrown when spawn command was existed but non-executable
5 participants