Skip to content

[async_hooks] stable API - tracking issue #124

Description

@AndreasMadsen

I posted requirements list for getting async_hooks into stable a while ago (nodejs/node#14717 (comment)). This is a very similar list.

Internal Technical

Internal Non-Technical

External Non-Technical

After Stable

Activity

  1. AndreasMadsen commented on Nov 20, 2017

    @AndreasMadsen
    MemberAuthor

    /cc @nodejs/async_hooks @nodejs/diagnostics

  2. AndreasMadsen commented on Nov 20, 2017

    @AndreasMadsen
    MemberAuthor

    /cc @jasnell who sometimes asks me about this

  3. refack commented on Nov 20, 2017

    @refack

    @AndreasMadsen how about adding some external criteria, like TC39 uses or N-API (nodejs/node#14532)

    1. major APM vendor that uses async_hooks (N/Solid)
    2. npm modules with at least 5000 DL/month based on async_hooks (https://www.npmjs.com/package/trace & https://www.npmjs.com/package/cls-hooked)
  4. AndreasMadsen commented on Nov 20, 2017

    @AndreasMadsen
    MemberAuthor

    @refack added your 1. and 2. to the list. I'm not sure what you mean by TC39 uses. Regarding N-API I don't see why that should be a requirement. async_hooks has its own native Embedder API outside N-API, we can mark that as stable without N-API. In fact N-API shouldn't be marked stable before the async_hooks native Embedder API is marked stable since they depend on that. But async_hooks doesn't depend on N-API.

  5. refack commented on Nov 20, 2017

    @refack

    Thanks. I just referenced TC39 and N-API as processes that use exit criteria that are independent of the development process, but take into account ecosystem adoption. So I agree that stability of N-API and async_hooks are independent (except for the embedder API)

  6. vdeturckheim commented on Nov 24, 2017

    @vdeturckheim
    Member

    FWIW, We plan to start using Async Hooks in Sqreen Agent in the upcomming weeks.

  7. hybrist commented on Nov 29, 2017

    @hybrist
    Contributor
  8. kjin commented on Nov 29, 2017

    @kjin
    Contributor

    PR to add async_hooks in Stackdriver Trace: googleapis/cloud-trace-nodejs#538

  9. AndreasMadsen commented on Jan 10, 2018

    @AndreasMadsen
    MemberAuthor

    Updated "Deprecate setTriggerId"

  10. AndreasMadsen commented on Jan 10, 2018

    @AndreasMadsen
    MemberAuthor

    Added:

  11. bmeurer commented on Jan 16, 2018

    @bmeurer
    Member

    So based on discussion in the benchmarking WG meeting yesterday I did setup test cases to run the Promise heavy Bluebird and Wikipedia benchmarks (used by the V8 project) with and without async_hooks to answer the first question in this thread, and slow-down is pretty significant even with just an empty init hook.

    @mhdawson suggested to kick-off some discussion on the performance via nodejs/benchmarking#188 and bubble up the issue to make sure we consider the performance aspect before async_hooks goes out of EXPERIMENTAL.

  12. mike-kaufman commented on Jan 24, 2018

    @mike-kaufman
    Contributor

    FYI I added an item to list above to identify the perf impact we're willing to tolerate from async-hooks. Current benchmark data cited in nodejs/benchmarking#181 show a ~2x-3x slowdown.

  13. bnb commented on Apr 16, 2018

    @bnb

    Any thoughts on if this will be coming out of Experimental before v10 launches? Looking at the remaining items I can't quite tell if there are still significant barriers because I'm not familiar enough with the subject 🤔

  14. lykkin commented on Apr 16, 2018

    @lykkin
    Contributor

    We haven't run into any blockers in the New Relic agent.

    The primary concern we've come up against is an extension of the lifetime of a promise leads to drastically increased memory usage. This only seems to be an issue with immediately resolved promises (e.g. Promise.resolve()), since those don't emit an after event and have to be cleared on destroy. This situation only causes an issue when there is an existing promise leak and just requires us to be more diligent about finding and eliminating leaks in libraries we interact with. I don't think this issue affects the shape of the API, so it's definitely not a blocker.

    We currently only instrument core promises using async hooks, though the data exposed through the hooks should be enough to move over the rest of the core instrumentation when the feature is fully released.

  15. 19 remaining items

  16. github-actions commented on Jul 19, 2020

    @github-actions

    This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

  17. kamalmarhubi commented on Jul 19, 2020

    @kamalmarhubi

    I figure this shouldn't go stale since it's a long-lived tracking issue?

  18. adamyeats commented on Jul 27, 2020

    @adamyeats

    Hey team, sorry it has taken me so long to follow up. Last time we spoke I believe you asked me to experiment with the async_hooks API more. We now have an async_hooks implementation in production in our Node.js integration - although it is not much different (if at all) from Cloud Trace's implementation.

    I have some thoughts and feedback on the API that it would be great to sync with you all on at some point (if you have time), but it would be good to know if there's anything further you'd like me to do to move this forward?

  19. mhdawson commented on Jul 27, 2020

    @mhdawson
    Member

    @xadamy maybe you can plan to come ot the next diagnostics meeting and give the team a runthrough of your thoughts.

  20. mhdawson commented on Oct 28, 2020

    @mhdawson
    Member

    closing in favor of #437

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions