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
base: master
from

Conversation

@addaleax
Copy link
Member

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

addaleax added some commits Jan 28, 2019

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

@addaleax addaleax added the ES Modules label Jan 28, 2019

@addaleax

This comment has been minimized.

Copy link
Member Author

addaleax commented Jan 28, 2019

@addaleax

This comment has been minimized.

Copy link
Member Author

addaleax commented Jan 28, 2019

@targos

targos approved these changes Jan 28, 2019

@lpinca

lpinca approved these changes Jan 29, 2019

@addaleax

This comment has been minimized.

Copy link
Member Author

addaleax commented Jan 30, 2019

Landed in 94ebf3f, 7fa5157

@addaleax addaleax closed this Jan 30, 2019

@addaleax addaleax deleted the addaleax:esm-no-process-exit branch Jan 30, 2019

addaleax added a commit that referenced this pull request Jan 30, 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.

PR-URL: #25769
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

addaleax added a commit that referenced this pull request Jan 30, 2019

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 trigger a “real”
uncaught exception.

PR-URL: #25769
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

targos added a commit that referenced this pull request Jan 30, 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.

PR-URL: #25769
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

targos added a commit that referenced this pull request Jan 30, 2019

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 trigger a “real”
uncaught exception.

PR-URL: #25769
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment