-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
regression: UnhandledPromiseRejection is not fired until process is terminated #24209
Comments
(+cc @apapirovski who seems to be working on a related stuff) |
It was regressed by following PR: #18207 |
Any updates on this? This is really unfortunate since scripts just hang in inconsistent state without letting users know that something's wrong. |
maybe cc @nodejs/promises-debugging |
/ping @apapirovski |
re-pinging @nodejs/promises-debugging Is this a known issue? Works-as-expected/not-a-bug? Confirmed bug? Something else? |
Ideally it would trigger the warning as soon as possible (as in: after a single tick). To prevent the recursion from being possible, that's not an option though (it should actually be possible for the case that no such listener is attached, since then there is no possibility for the recursion in the first place but this would result in different timings with the listener attached and without). However, we are able to trigger the warning on setImmediate / right after the microtask queue is exhausted. It is already implemented to trigger on queue exhaustion and therefore I guess it's a bug in the implementation for cases like these.
|
The summary of this bug isn't quite correct. |
Oftentimes program transitions into inconsistent state after throwing an exception and hangs forever; you never know if it's just slow fetching resources from the Web or it has thrown an exception until you terminate it. Thank you @apapirovski for handling this ❤️ |
PR-URL: nodejs#24632 Fixes: nodejs#24209 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
Fixed in 3ce9305 |
PR-URL: #24632 Fixes: #24209 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
PR-URL: nodejs#24632 Fixes: nodejs#24209 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
PR-URL: #24632 Fixes: #24209 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
PR-URL: #24632 Fixes: #24209 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
Repro
script.js
:node script.js
Expected: the
UnhandledPromiseRejection
is reported as soon as it happens; the node.js processexits after 2 seconds.
Actual: nothing happens for 2 seconds, then the node.js process exits and only then prints
UnhandledPromieRejection
.This works as expected in v8.12.0
The text was updated successfully, but these errors were encountered: