-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
domain migration to async_hooks #17143
Comments
I’d say we should runtime deprecate support for that once async_hooks is stable?
Yes. We need:
|
Honestly, I would go one step further and runtime deprecate it now and remove it once |
@AndreasMadsen I think https://blog.newrelic.com/2017/11/08/node-8-async-await-support/ |
@AndreasMadsen Any ideas for that? I’d probably just replace |
@addaleax Yes, I think that would be fine. |
Introduce `process.shouldAbortOnUncaughtException` to control `--abort-on-uncaught-exception` behaviour, and implement some of the domains functionality on top of it. Refs: nodejs#17143
@AndreasMadsen if I understand well, I just need to move the domain related code from |
@vdeturckheim That would be awesome. It should be possible to do it with a monkey-patch of EventEmitter or similar hack. More creative solutions is of course appreciated as well. |
lgtm, that's what I had in mind. |
Added:
|
@AndreasMadsen ccan you tick the event-related item? |
@vdeturckheim Done 👍 |
@AndreasMadsen How would you feel about That would allow us to remove |
@addaleax Could a |
I don't see how you can emit the |
@TimothyGu I think so (although I was thinking @AndreasMadsen Yeah, init would have to be emitted before the call, coming from the void and reporting an unknown resource type. It’s not optimal. ;) |
If that was the only concern it would be fine. What is important is that |
Just a note to say that I've updated the checklist in the OP with some recent changes & PR links. |
is now done :) We can "Remove |
For moving forward with this, I would suggest: node.js 11.0.0
node.js 12.0.0
The change to the module resolution is kinda nasty, but it is the only way I see that we could do the transition gracefully with a deprecation warning. edit: The deprecation warning will just tell the user to run |
@AndreasMadsen LGTM. |
I should add, some modules already integrate with |
As @apapirovski mentionned (#20474 (comment)), domain are still used in the REPL. Would we want to ship the external module in the REPL still? |
@vdeturckheim Ah, I was not aware we used Even if we choose a different name for |
@AndreasMadsen I took a first look and it does not look straightforward to remove. I'm not certain that replacing it will not lead to the creation of another domain-like API |
@vdeturckheim I agree. It is quite a big concern. I'm not sure what the correct approach is here. /cc @nodejs/repl |
Can somebody explain why we want to remove the We use it in the REPL to catch errors coming from user code. Since we expose the REPL in a programmatically accessible way (e.g. there can be multiple REPL instances per Node.js instance), and we need a way to distinguish errors created by each, I think removing the domain module would imply that we need to implement most of its functionality in the REPL module itself… |
@addaleax I have to admit I don't know the full context. I have always known this module in its deprecation phase and assumed this would lead to it being removed from Node. They have been discussions in a thread I opened this week (#20474) that made me think it was a goal to achieve. TBH, I like this module and feel like it makes sense to keep it in Node. I am not sure what is the case against this module. |
/cc @mcollina @AyushG3112 @ofrobots Care to comment on domain removal? |
I think there are users that likes this module a lot. Our current position is that it was a mistake and it should not be used. If we want to add new features and improve this, then we should declare it supported and keep evolving it. Or we should move it to userland, and so the people that want this improved can work and improve it. This PR was fine because it simplified things. |
Domains have a few more tentacles into the code-base, e.g.
|
Zones.js doesn't actually use |
SGTM. I just don't think we should do anything to domains that exists in core for now. An alternative can be built in user-space, and once it is there we can figure out the next steps. |
I also personally believe that However, the |
I would like to encourage people to notify the @nodejs/domains, @nodejs/diagnostics and @nodejs/post-mortem teams when important discussions need to happen with regards to this PR. I would also like to reiterate what others have mentioned in comments of this PR, which is that domains are used by a non-negligible number of users, and that unless keeping the |
@AndreasMadsen Should this issue be left open or closed? I'm under the impression that there is no realistic intention of removing |
Looks like we still need to complete "Remove .domain support from MakeCallback". The depreciation code is still in master. So I would suggest removing that code before closing this issue. I should make |
The PR #16222, contains the first step by @vdeturckheim to remove
domain
from the deep layers of nodecore and implement it on top ofasync_hooks
. This PR just landed, thus I'm opening this issue to discuss the next steps..domain
support fromMakeCallback
. Implementers should useasync_context
. What will our depreciation and removal strategy for this be? Note: we would like to ultimately remove this as it adds quite a bit of extra complexity..domain
support fromMakeCallback
(PR: domain: runtime deprecate MakeCallback #17417).domain
support fromMakeCallback
It is unclear what the migration strategy for this is.(PR: process: add capture function for uncaught exceptions #17159)async_hooks
(PR: domain: re-implement domain over async_hook #16222)/cc @addaleax @vdeturckheim
The text was updated successfully, but these errors were encountered: