Skip to content

diagnostics_channel: grow native channel storage#64497

Open
Qard wants to merge 1 commit into
nodejs:mainfrom
Qard:agent/grow-native-diagnostics-channel-storage
Open

diagnostics_channel: grow native channel storage#64497
Qard wants to merge 1 commit into
nodejs:mainfrom
Qard:agent/grow-native-diagnostics-channel-storage

Conversation

@Qard

@Qard Qard commented Jul 14, 2026

Copy link
Copy Markdown
Member

Every string-named diagnostics channel currently consumes an entry in a fixed
native subscriber array, so creating more than 1,024 channels terminates the
process at a native CHECK.

Only channels used by native publishers now receive native slots, and the
subscriber buffer grows when it fills. This removes the arbitrary crash while
preserving subscriber tracking and snapshot behavior.

Every string-named JavaScript channel consumed an entry in the fixed
native subscriber array. Creating more than 1,024 channels triggered a
CHECK and terminated the process.

Allocate slots only for native publishers and grow the aliased buffer
when it fills. Refresh the JavaScript view after resizing and preserve
the capacity in snapshots.

Signed-off-by: Stephen Belanger <admin@stephenbelanger.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. diagnostics_channel Issues and PRs related to diagnostics channel needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. labels Jul 14, 2026
@Qard Qard self-assigned this Jul 14, 2026
@Qard Qard added request-ci Add this label to start a Jenkins CI on a PR. and removed process Issues and PRs related to the process subsystem. labels Jul 14, 2026
@Qard Qard marked this pull request as ready for review July 14, 2026 12:35
@Qard Qard marked this pull request as draft July 14, 2026 12:36
@Qard Qard marked this pull request as ready for review July 14, 2026 12:36
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.23%. Comparing base (ed63b19) to head (af80173).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
lib/diagnostics_channel.js 53.84% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64497      +/-   ##
==========================================
- Coverage   92.01%   90.23%   -1.79%     
==========================================
  Files         381      741     +360     
  Lines      170167   241701   +71534     
  Branches    26075    45548   +19473     
==========================================
+ Hits       156585   218087   +61502     
- Misses      13291    15156    +1865     
- Partials      291     8458    +8167     
Files with missing lines Coverage Δ
lib/internal/process/pre_execution.js 98.07% <100.00%> (+16.60%) ⬆️
src/node_diagnostics_channel.cc 83.51% <100.00%> (ø)
src/node_diagnostics_channel.h 57.14% <ø> (ø)
lib/diagnostics_channel.js 97.57% <53.84%> (+7.05%) ⬆️

... and 481 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

c++ Issues and PRs that require attention from people who are familiar with C++. diagnostics_channel Issues and PRs related to diagnostics channel needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants