Skip to content

Conversation

@joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Jan 17, 2026

This adds a trackPromises option that allows users to completely opt out of the promise hooks that are installed whenever an async hook is added. For those who do not need to track promises, this avoids the excessive hook invocation and the heavy overhead from it.

This option was previously already implemented internally to skip the noise from promise hooks when debugging async operations via the V8 inspector. This patch just exposes it.

Refs: #57148

@nodejs-github-bot nodejs-github-bot added async_hooks Issues and PRs related to the async hooks subsystem. needs-ci PRs that need a full CI run. labels Jan 17, 2026
This adds a trackPromises option that allows users to completely opt
out of the promise hooks that are installed whenever an async hook is
added. For those who do not need to track promises, this avoids
the excessive hook invocation and the heavy overhead from it.

This option was previously already implemented internally to skip the
noise from promise hooks when debugging async operations via the
V8 inspector. This patch just exposes it.
@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.51%. Comparing base (1bd7f62) to head (2241850).
⚠️ Report is 54 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61415      +/-   ##
==========================================
- Coverage   88.51%   88.51%   -0.01%     
==========================================
  Files         704      704              
  Lines      208739   208896     +157     
  Branches    40274    40335      +61     
==========================================
+ Hits       184770   184905     +135     
- Misses      15968    15976       +8     
- Partials     8001     8015      +14     
Files with missing lines Coverage Δ
lib/async_hooks.js 100.00% <100.00%> (ø)
lib/internal/inspector_async_hook.js 100.00% <100.00%> (ø)

... and 57 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants