Skip to content
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

Closed

Conversation

addaleax
Copy link
Member

@addaleax addaleax commented Jun 2, 2017

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), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included (how do you test that nothing happens?)
  • commit message follows commit guidelines
Affected core subsystem(s)

async_hooks

/cc @nodejs/async_hooks

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.
@nodejs-github-bot nodejs-github-bot added async_hooks Issues and PRs related to the async hooks subsystem. async_wrap c++ Issues and PRs that require attention from people who are familiar with C++. labels Jun 2, 2017
AndreasMadsen
AndreasMadsen previously approved these changes Jun 2, 2017
Copy link
Member

@AndreasMadsen AndreasMadsen left a 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.

Copy link
Member

@AndreasMadsen AndreasMadsen left a 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 :/

@AndreasMadsen AndreasMadsen dismissed their stale review June 3, 2017 14:32

I think we have to solve #13427 before we can think about tear down.

@matthewloring
Copy link

The approach seems good. Was there a particular use case you had in mind for dynamically disabling these hooks?

@addaleax
Copy link
Member Author

addaleax commented Jun 3, 2017

Was there a particular use case you had in mind for dynamically disabling these hooks?

No, but that applies to .disable() in general; I don’t really know why people would want to, but I’m sure there’s a reason for that.

@matthewloring
Copy link

Yup, agreed. I was just curious if there was a specific need.

Copy link
Contributor

@trevnorris trevnorris left a 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.

@trevnorris
Copy link
Contributor

I'll have a PR ready soon to fix this.

@trevnorris
Copy link
Contributor

@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.

@addaleax
Copy link
Member Author

addaleax commented Jun 6, 2017

@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.

@addaleax addaleax closed this Jun 6, 2017
@addaleax addaleax deleted the async-hooks-remove-promise-hooks branch June 9, 2017 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
async_hooks Issues and PRs related to the async hooks subsystem. c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants