Skip to content
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

module: do not use process.exit() #25769

Closed
wants to merge 3 commits into from

Conversation

addaleax
Copy link
Member

@addaleax addaleax commented Jan 28, 2019

module: silence ModuleJob unhandled rejection warnings

This could otherwise print unhandled rejection warnings
if the process does not exit immediately inside an earlier
.catch() handler.

module: do not use process.exit()

Inside workers, using stdio is always asynchronous, so using
process.exit() always interrupts sending of messages to the
parent thread, including error messages presented over stdio.

Do not use process.exit() and instead use the cleaner
process.exitCode directly
trigger a “real” uncaught exception.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

This could otherwise print unhandled rejection warnings
if the process does not exit immediately inside an earlier
`.catch()` handler.
Inside workers, using stdio is always asynchronous, so using
`process.exit()` always interrupts sending of messages to the
parent thread, including error messages presented over stdio.

Do not use `process.exit()` and instead use the cleaner
`process.exitCode` directly.
@addaleax addaleax added the esm Issues and PRs related to the ECMAScript Modules implementation. label Jan 28, 2019
@addaleax
Copy link
Member Author

@addaleax
Copy link
Member Author

addaleax commented Jan 28, 2019

CI: https://ci.nodejs.org/job/node-test-pull-request/20376/ (:heavy_check_mark:)

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 28, 2019
@addaleax
Copy link
Member Author

Landed in 94ebf3f, 7fa5157

@addaleax addaleax closed this Jan 30, 2019
@addaleax addaleax deleted the esm-no-process-exit branch January 30, 2019 17:18
addaleax added a commit that referenced this pull request Jan 30, 2019
This could otherwise print unhandled rejection warnings
if the process does not exit immediately inside an earlier
`.catch()` handler.

PR-URL: #25769
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax added a commit that referenced this pull request Jan 30, 2019
Inside workers, using stdio is always asynchronous, so using
`process.exit()` always interrupts sending of messages to the
parent thread, including error messages presented over stdio.

Do not use `process.exit()` and instead trigger a “real”
uncaught exception.

PR-URL: #25769
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Jan 30, 2019
This could otherwise print unhandled rejection warnings
if the process does not exit immediately inside an earlier
`.catch()` handler.

PR-URL: #25769
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Jan 30, 2019
Inside workers, using stdio is always asynchronous, so using
`process.exit()` always interrupts sending of messages to the
parent thread, including error messages presented over stdio.

Do not use `process.exit()` and instead trigger a “real”
uncaught exception.

PR-URL: #25769
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. esm Issues and PRs related to the ECMAScript Modules implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants