-
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
async_hooks: tear down hooks if none are in use #13416
Conversation
Basically, reset everything into its original state once all async hooks have been disabled as closely as possible. This has been requested by Andreas, and I agree that it makes sense.
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.
Thanks.
LGTM, but I would like another 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.
I think we have to solve #13427 before we can think about tear down.
edit: it would be lovely if one could delete review comments :/
I think we have to solve #13427 before we can think about tear down.
The approach seems good. Was there a particular use case you had in mind for dynamically disabling these hooks? |
No, but that applies to |
Yup, agreed. I was just curious if there was a specific need. |
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.
There was no reason for 410b141 and there isn't any reason for this. There is zero extra overhead for setting the functions early, but there is overhead for setting them again.
I'll have a PR ready soon to fix this. |
@addaleax please excuse the rudeness of my earlier comment. i've been preoccupied with other work and wasn't involved as much the last couple weeks as I should have been. the comment was a reaction at my frustration with myself for this reason. it wasn't meant for you. i'm sorry. |
@trevnorris Don’t worry about it, I didn’t even catch up to read it until now. 😄 Your PR seems just as fine to me, I think this can be closed. |
Basically, reset everything into its original state once all
async hooks have been disabled as closely as possible.
This has been requested by Andreas, and I agree that it makes sense.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
async_hooks
/cc @nodejs/async_hooks