-
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
repl: do not swallow errors in nested REPLs #23004
Conversation
For tab completion, a REPLServer instance will sometimes create another REPLServer instance. If a callback is sent to the `.complete()` function and that callback throws an error, it will be swallowed by the nested REPLs domain. Re-throw the error so that processes don't silently exit without any indication of an error (including a status code). Fixes: nodejs#21586
semver-major because it is surfacing the error. |
In favor of this being patch rather than major: This is a bug that was introduced in Node.js 9.9.0. The bug did not exist in Node.js 9.8.0. (I'm guessing 9.8.0 didn't have the nested REPL thing happening under the hood, so there wasn't a second domain to swallow the error.) So we're restoring previous behavior that was unintentionally altered, rather than surfacing an error that was never surfaced before. That said, I know semver-ness is a very eye-of-the-beholder thing and I'm fine with this being semver-major, although I'd definitely like to push for it being in 11.0.0 in that case. Adding to the milestone now... |
Only failure was a |
As always, I'm +1 on patch if there's consensus on TSC. Just labeled it because of policy. |
/ping @rubys @nodejs/repl @nodejs/tsc |
This needs more reviews. Already pinged TSC and REPL team, so...going bigger. Sorry. @nodejs/collaborators |
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.
I am +1 on this change and am +1 on semver-patch, this looks like a clear cut bug fix. I will of course defer to others if anyone more believable on our REPL feels strongly about it.
+1 for it to be semver-patch. |
Seems to be agreement that this is semver-patch, so I'm going to remove the semver-major label. If anyone disagrees, please re-add the label. Regardless, I wouldn't mind one more @nodejs/tsc review! |
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.
+1 for semver-patch, but I don't think there's much harm in being conservative and landing this as semver-major. I get the point that it's a bugfix, but it does introduce/surface new errors in places it won't throw earlier.
We can add |
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.
LGTM
For tab completion, a REPLServer instance will sometimes create another REPLServer instance. If a callback is sent to the `.complete()` function and that callback throws an error, it will be swallowed by the nested REPLs domain. Re-throw the error so that processes don't silently exit without any indication of an error (including a status code). Fixes: nodejs#21586 PR-URL: nodejs#23004 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Landed in 83d0404 |
For tab completion, a REPLServer instance will sometimes create another
REPLServer instance. If a callback is sent to the
.complete()
functionand that callback throws an error, it will be swallowed by the nested
REPLs domain. Re-throw the error so that processes don't silently exit
without any indication of an error (including a status code).
Fixes: #21586
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes