async_hooks: tear down hooks if none are in use#13416
async_hooks: tear down hooks if none are in use#13416addaleax wants to merge 1 commit intonodejs:masterfrom
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.
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. |
trevnorris
left a comment
There was a problem hiding this comment.
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