Skip to content

diagnostic_channel: use DisposableStack - #67533

Open
LiviaMedeiros wants to merge 3 commits into
nodejs:mainfrom
LiviaMedeiros:diagnostics-channel-using-disposablestack
Open

LiviaMedeiros wants to merge 3 commits into
nodejs:mainfrom
LiviaMedeiros:diagnostics-channel-using-disposablestack

Conversation

@LiviaMedeiros

@LiviaMedeiros LiviaMedeiros commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

ERM is unflagged in v27.x+.

This PR

@LiviaMedeiros LiviaMedeiros added revert PRs that revert previously landed PRs. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. dont-land-on-v26.x PRs that should not land on the v26.x-staging branch and should not be released in v26.x. labels Nov 16, 2026
@nodejs-github-bot nodejs-github-bot added diagnostics_channel Issues and PRs related to the diagnostics_channel module. needs-ci PRs that need a full CI run. labels Nov 16, 2026
@LiviaMedeiros LiviaMedeiros added commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. needs-ci PRs that need a full CI run. diagnostics_channel Issues and PRs related to the diagnostics_channel module. and removed needs-ci PRs that need a full CI run. diagnostics_channel Issues and PRs related to the diagnostics_channel module. labels Nov 16, 2026
Comment thread lib/internal/per_context/primordials.js Resolved
Totes three classes:
- `DisposableStack`
- `AsyncDisposableStack`
- `SuppressedError`

Signed-off-by: LiviaMedeiros <livia@cirno.name>
@LiviaMedeiros
LiviaMedeiros force-pushed the diagnostics-channel-using-disposablestack branch from 73881ba to e3c4ddd Compare November 17, 2026 00:35
@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.67%. Comparing base (cb4cba6) to head (63cd7e3).
⚠️ Report is 36 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67533      +/-   ##
==========================================
- Coverage   90.68%   90.67%   -0.02%     
==========================================
  Files         800      800              
  Lines      280489   281061     +572     
  Branches    54173    54308     +135     
==========================================
+ Hits       254373   254857     +484     
- Misses      16239    16302      +63     
- Partials     9877     9902      +25     
Files with missing lines Coverage Δ
lib/diagnostics_channel.js 98.24% <100.00%> (+0.60%) ⬆️
lib/internal/freeze_intrinsics.js 97.11% <100.00%> (+0.06%) ⬆️
lib/internal/per_context/primordials.js 98.22% <100.00%> (+<0.01%) ⬆️

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

@Renegade334 Renegade334 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The concern about using in core previously was that any PR that uses it won't be backportable to prior release lines. Obviously this specific PR won't be backported anyway, but any change that subsequently touches these methods would then need manual backporting.

That being said, "straightforward" registration of a single non-throwing disposer can just as easily remain try...finally rather than using, so it's only cases like this that require the more complex DisposableStack behaviour that will really need to lean on "true" ERM. I can't imagine there will much need for it elsewhere in core, so the maintenance burden is probably not awful.

Comment thread lib/eslint.config_partial.mjs Resolved
@LiviaMedeiros
LiviaMedeiros force-pushed the diagnostics-channel-using-disposablestack branch from e3c4ddd to b4ab817 Compare November 17, 2026 15:01
Signed-off-by: LiviaMedeiros <livia@cirno.name>

@aduh95 aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that Node.js 24 is in Maintenance mode, using using in core should be fine – we want to backport that to Node.js 26 though

@LiviaMedeiros LiviaMedeiros added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Nov 17, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 17, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. diagnostics_channel Issues and PRs related to the diagnostics_channel module. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. dont-land-on-v26.x PRs that should not land on the v26.x-staging branch and should not be released in v26.x. needs-ci PRs that need a full CI run. revert PRs that revert previously landed PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants