-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Allow registering multiple uncaught exception capture callbacks #23348
Comments
Makes a sense to me as long as no major perf overhead. |
I'd be 👍 for such update. Also, we could update the domain's callback to accept to call other ones after itself but this might get pretty confusing. @mhdawson I think perf impact would only happen when there is an uncaught exception, which should be rare in theory |
Submitted a proof-of-concept PR at #24279. @vdeturckheim @mhdawson I would be grateful if you had the time to give me some feedback on that :) |
Currently, only one domain-lke implementation (the core domain one) can be used to handle uncaught exceptions or unhandled error events. This PR aims at making it possible for different domain-like user-land implementations to be used concurrently (including with the core domain impl) so that the state of the core domain module (doc deprecated) does not prevent users of domains from having a well-maintained domain-like facility. Ref: nodejs#23348
Currently, only one domain-lke implementation (the core domain one) can be used to handle uncaught exceptions or unhandled error events. This PR aims at making it possible for different domain-like user-land implementations to be used concurrently (including with the core domain impl) so that the state of the core domain module (doc deprecated) does not prevent users of domains from having a well-maintained domain-like facility. Ref: nodejs#23348
Currently, only one domain-lke implementation (the core domain one) can be used to handle uncaught exceptions or unhandled error events. This PR aims at making it possible for different domain-like user-land implementations to be used concurrently (including with the core domain impl) so that the state of the core domain module (doc deprecated) does not prevent users of domains from having a well-maintained domain-like facility. Ref: nodejs#23348 Co-authored-by: Rich Trott <rtrott@gmail.com>
Currently, only one domain-lke implementation (the core domain one) can be used to handle uncaught exceptions or unhandled error events. This PR aims at making it possible for different domain-like user-land implementations to be used concurrently (including with the core domain impl) so that the state of the core domain module (doc deprecated) does not prevent users of domains from having a well-maintained domain-like facility. Ref: nodejs#23348 Co-authored-by: Rich Trott <rtrott@gmail.com>
Currently, only one domain-lke implementation (the core domain one) can be used to handle uncaught exceptions or unhandled error events. This PR aims at making it possible for different domain-like user-land implementations to be used concurrently (including with the core domain impl) so that the state of the core domain module (doc deprecated) does not prevent users of domains from having a well-maintained domain-like facility. Ref: nodejs#23348 Co-authored-by: Rich Trott <rtrott@gmail.com>
Currently, only one domain-lke implementation (the core domain one) can be used to handle uncaught exceptions or unhandled error events. This PR aims at making it possible for different domain-like user-land implementations to be used concurrently (including with the core domain impl) so that the state of the core domain module (doc deprecated) does not prevent users of domains from having a well-maintained domain-like facility. Ref: nodejs#23348 Co-authored-by: Rich Trott <rtrott@gmail.com>
Currently, only one domain-lke implementation (the core domain one) can be used to handle uncaught exceptions or unhandled error events. This PR aims at making it possible for different domain-like user-land implementations to be used concurrently (including with the core domain impl) so that the state of the core domain module (doc deprecated) does not prevent users of domains from having a well-maintained domain-like facility. Ref: nodejs#23348 Co-authored-by: Rich Trott <rtrott@gmail.com>
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment. For more information on how the project manages feature requests, please consult the feature request management document. |
Is your feature request related to a problem? Please describe.
While experimenting with building a user-land alternative to the core
domain
module, I realized that the fact that one can only set one uncaught exception callback makes it more difficult than it could be.Basically, the problem is that it is not possible to have two different implementations of a "domain-like" module loaded at the same time in a given process. For instance, it is currently not possible to load the user-land
domaine
module along with the coredomain
module.This makes it difficult for applications to start adopting user-land alternatives to
domain
: in the current state, they (and all their dependencies) either need to adopt one single user-land alternative, or stick with thecore
domain module.A good example is when I ported restify to use this new
domaine
module instead of the coredomain
module. I had to portnode-tap
(which is used to run restify's tests) to use that newdomaine
module as well.Another example is the fact that one cannot use a user-land domain-like module from within the core repl because it requires
domain
.This is something that I started discussing with @addaleax but that I thought would benefit from being presented to a broader set of people to gather initial feedback, comments and suggestions.
Describe the solution you'd like
The fundamental change would be to allow multiple uncaught exception callbacks to be registered.
I haven't thought too much about the design or the implementation details of a specific solution. I'd first like to gather feedback on whether people would be open to allowing multiple callbacks to be registered.
Describe alternatives you've considered
The only alternative to having this feature available that I can see for now is to require applications to migrate their code and all their dependencies to any user-land domain module that they choose to use.
Looking forward to reading your thoughts!
/cc @addaleax @vdeturckheim @nodejs/domains
The text was updated successfully, but these errors were encountered: