Skip to content

Wrap handle callbacks with console.createTask(...) #47444

Description

@Qard

What is the problem this feature will solve?

Currently stack traces are not great with most callback-based code. Some modules exist to produce long stack traces with async_hooks, however the performance impact can be significant. V8 now has its own built-in solution, so we should investigate if that can produce better results.

What is the feature you are proposing to solve the problem?

A recent V8 update has provided the console.createTask(...) API. We can start pairing that with our existing handle callbacks to gain much better stack traces.

See: #44792

It also has the potential to be integrated with the AsyncContext spec in the future to be used as an equivalent to AsyncResource. This could mean we get context-linkage of callback-based code automatically in the future.

cc @nodejs/diagnostics

What alternatives have you considered?

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    async_hooksIssues and PRs related to the async hooks subsystem.discussIssues opened for discussion and feedback.errorsIssues and PRs related to JavaScript errors originating in Node.js core.feature requestIssues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions