repl: properly handle uncaughtException#27151
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thinking about the semverness again: it should actually be semver-minor, not major. The reason is that as standalone REPL it only interacts with the user directly and the former behavior was unexpected (it was just ignored). Now it works as it would in an regular application. |
Sorry, something went wrong.
|
@nodejs/repl PTAL |
Sorry, something went wrong.
Sorry, something went wrong.
lance
left a comment
There was a problem hiding this comment.
Other than one small wording suggestion, this LGTM
Sorry, something went wrong.
Sorry, something went wrong.
|
@apapirovski you reviewed the older PR, would you mind taking another look? @nodejs/repl this could use some further reviews. |
Sorry, something went wrong.
When running the REPL as standalone program it's now possible to use
`process.on('uncaughtException', listener)`. It is going to use those
listeners from now on and the regular error output is suppressed.
It also fixes the issue that REPL instances started inside of an
application would silence all application errors. It is now prohibited
to add the exception listener in such REPL instances. Trying to add
such listeners throws an `ERR_INVALID_REPL_INPUT` error.
PR-URL: nodejs#27151
Fixes: nodejs#19998
Reviewed-By: Lance Ball <lball@redhat.com>
Sorry, something went wrong.
|
@vsemozhetbyt yes :/ I would like to force-push it out since nothing else landed since but it's quite some time ago. @nodejs/tsc if anyone is around, are you fine with that? |
Sorry, something went wrong.
|
@BridgeAR If you are somewhat certain that that’s not causing a lot of trouble, I’m okay with it – it’s Sunday & a large holiday after all, and I haven’t seen anything happen that would conflict. But if you want to open a quick revert PR, here’s my 👍 to fast-tracking. |
Sorry, something went wrong.
|
@addaleax I decided to force-push since I have not seen any activity in any other PR either (besides one that I opened in the meanwhile). I'll fix the PR here and rerun the CI before landing it again. |
Sorry, something went wrong.
|
Is there a better name for EDIT: Oh, and it only affects the interactive REPL, right? |
Sorry, something went wrong.
I personally doubt that this would really confuse anyone since the error message would clarify what it's about and it can only happen for the user of the REPL instance, so it's a direct feedback. I also doubt that it's a problem that the error can only happen when running the REPL inside of another program (it's just not relevant for the standalone REPL). We could go into a different direction as well and use something like |
Sorry, something went wrong.
|
This mostly seems good to me (aside from some minor comments that I left on one of the tests), but I'm wrestling with if we really want to special-case the programmatic use case here. In other words, yes, adding an (Sorry if this has been discussed elsewhere and I just missed it.) Refs: #22112 |
Sorry, something went wrong.
|
I agree that it will be surprising if this reveals any problems, but just to be thorough.... CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1845/ ✔️ |
Sorry, something went wrong.
|
Absurd micro-nit: Our commit guidelines say to use an imperative verb as the first word after the subsystem. So instead of "properly handle..." maybe it should be "handle ... properly"? |
Sorry, something went wrong.
When running the REPL as standalone program it's now possible to use
`process.on('uncaughtException', listener)`. It is going to use those
listeners from now on and the regular error output is suppressed.
It also fixes the issue that REPL instances started inside of an
application would silence all application errors. It is now prohibited
to add the exception listener in such REPL instances. Trying to add
such listeners throws an `ERR_INVALID_REPL_INPUT` error.
Fixes: nodejs#19998
PR-URL: nodejs#27151
Fixes: nodejs#19998
Reviewed-By: Lance Ball <lball@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
(Sorry, I just realized I forgot to rerun the CI after the fixup commit) |
Sorry, something went wrong.
When running the REPL as standalone program it's now possible to use
`process.on('uncaughtException', listener)`. It is going to use those
listeners from now on and the regular error output is suppressed.
It also fixes the issue that REPL instances started inside of an
application would silence all application errors. It is now prohibited
to add the exception listener in such REPL instances. Trying to add
such listeners throws an `ERR_INVALID_REPL_INPUT` error.
Fixes: #19998
PR-URL: #27151
Fixes: #19998
Reviewed-By: Lance Ball <lball@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Notable changes:
* process:
* Log errors using `util.inspect` in case of fatal exceptions
(Ruben Bridgewater) #27243
* repl:
* Add `process.on('uncaughtException')` support (Ruben Bridgewater)
#27151
* stream:
* Implemented `Readable.from` async iterator utility (Guy Bedford)
#27660
* tls:
* Expose built-in root certificates (Ben Noordhuis)
#26415
* Support `net.Server` options (Luigi Pinca)
#27665
* Expose `keylog` event on TLSSocket (Alba Mendez)
#27654
* worker:
* Added the ability to unshift messages from the `MessagePort`
(Anna Henningsen) #27294
Notable changes:
* esm:
* Added the `--experimental-wasm-modules` flag to support
WebAssembly modules (Myles Borins & Guy Bedford)
#27659
* process:
* Log errors using `util.inspect` in case of fatal exceptions
(Ruben Bridgewater) #27243
* repl:
* Add `process.on('uncaughtException')` support (Ruben Bridgewater)
#27151
* stream:
* Implemented `Readable.from` async iterator utility (Guy Bedford)
#27660
* tls:
* Expose built-in root certificates (Ben Noordhuis)
#26415
* Support `net.Server` options (Luigi Pinca)
#27665
* Expose `keylog` event on TLSSocket (Alba Mendez)
#27654
* worker:
* Added the ability to unshift messages from the `MessagePort`
(Anna Henningsen) #27294
PR-URL: #27799
Notable changes:
* esm:
* Added the `--experimental-wasm-modules` flag to support
WebAssembly modules (Myles Borins & Guy Bedford)
#27659
* process:
* Log errors using `util.inspect` in case of fatal exceptions
(Ruben Bridgewater) #27243
* repl:
* Add `process.on('uncaughtException')` support (Ruben Bridgewater)
#27151
* stream:
* Implemented `Readable.from` async iterator utility (Guy Bedford)
#27660
* tls:
* Expose built-in root certificates (Ben Noordhuis)
#26415
* Support `net.Server` options (Luigi Pinca)
#27665
* Expose `keylog` event on TLSSocket (Alba Mendez)
#27654
* worker:
* Added the ability to unshift messages from the `MessagePort`
(Anna Henningsen) #27294
PR-URL: #27799
When running the REPL as standalone program it's now possible to use
process.on('uncaughtException', listener). It is going to use thoselisteners from now on and the regular error output is suppressed.
It also fixes the issue that REPL instances started inside of an
application would silence all application errors. It is now prohibited
to add the exception listener in such REPL instances. Trying to add
such listeners throws an
ERR_INVALID_REPL_INPUTerror.Fixes: #19998
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes