-
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
12.16/13.8: http response listener throwing does not result in emit of uncaughtException #31796
Comments
Is there anything else you’re doing besides running the above script with |
Well that's embarrassing. Let me dig around a bit. It was failing in tests and then I ported out and ran via debugger and saw the same issues, but admittedly didn't run straight via script at that point. |
I think I let myself get tricked by the debugger. I'm back to thinking it is something we are doing that is incompatible with the new 12.16 code. Going to go ahead and close this out, can always re-open if proves real. |
Looks like something about creating an async hook is causing this. |
Specifically, looks like the existance of an Is this expected? Adding this to the top results in the breaking behavior... const asyncHooks = require('async_hooks')
var hook = asyncHooks.createHook({
// init: () => {},
// before: () => {},
after: () => {},
//destroy: () => {}
}).enable() |
What steps will reproduce the bug?
Throwing from a response listener (callback) to
http.get()
will not triggerprocess.once('uncaughtException', () => {})
. Interestingly, throwing from a request listener (callback) tohttp.createServer()
will still.This behavior changed with 12.16.0, I'm guessing likely due to the porting of the emit changes?
How often does it reproduce? Is there a required condition?
Consistently does not trigger
uncaughtException
/ does not allow handling viaprocess.on('uncaughtException', ...)
.What is the expected behavior?
Should be able to notice the uncaught exception thrown from the handler.
What do you see instead?
Additional information
The text was updated successfully, but these errors were encountered: