Skip to content

diagnostic_channel: use DisposableStack - #67533

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

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 116 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

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@LiviaMedeiros LiviaMedeiros added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 21, 2026
@nodejs-github-bot nodejs-github-bot added the commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. label Nov 21, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 21, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Commit Queue failed

  ✖  eda07822253bffe92899642ff4be3eecee31b09a
     ✖  8:7      Pull request URL must reference a comment or discussion. fixes-url
  ✖  91b4dc094eab1b4cd4af316d9d1e547c22467aa8
     ✖  4:7      Pull request URL must reference a comment or discussion. fixes-url
     ✖  0:0      Commit must have a "Signed-off-by" trailer signed-off-by
     ⚠  0:59     Title should be <= 59 columns.            title-length
  ✖  72322777013ff58d10c65e11928ee0fbbf9c16e3
     ✖  3:7      Pull request URL must reference a comment or discussion. fixes-url
     ⚠  0:50     Title should be <= 50 columns.            title-length

The pull request was removed from the Commit Queue and labeled commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. . After resolving the failure, remove that label and add commit-queue PRs queued for automated landing through the Commit Queue. to retry.

Full Commit Queue output
�[36m⠋�[39m Loading data for nodejs/node/pull/67533
�[36m⠋�[39m Loading data for nodejs/node/pull/67533
�[36m⠋�[39m Getting collaborator contacts from README of nodejs/node
�[36m⠋�[39m Getting PR from nodejs/node/pull/67533
�[36m⠋�[39m Getting reviews from nodejs/node/pull/67533
�[36m⠋�[39m Getting comments from nodejs/node/pull/67533
�[36m⠋�[39m Getting commits from nodejs/node/pull/67533
✔  Done loading data for nodejs/node/pull/67533
----------------------------------- PR info ------------------------------------
Title      diagnostic_channel: use `DisposableStack` (#67533)
Author     Livia Medeiros <livia@cirno.name> (@LiviaMedeiros)
Branch     LiviaMedeiros:diagnostics-channel-using-disposablestack -> nodejs:main
Labels     author ready, needs-ci, revert, commit-queue, diagnostics_channel, commit-queue-rebase, dont-land-on-v22.x, dont-land-on-v24.x, dont-land-on-v26.x
Commits    3
 - lib: add ERM classes to primordials
 - Revert "diagnostics_channel: replace using with try-finally"
 - diagnostics_channel: use `DisposableStack` primordial
Committers 1
 - LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67533
Fixes: https://github.com/nodejs/node/pull/67530
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/67533
Fixes: https://github.com/nodejs/node/pull/67530
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Mon, 16 Nov 2026 22:45:06 GMT
   ✔  Approvals: 2
   ✔  - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/67533#pullrequestreview-5943586095
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/67533#pullrequestreview-5956732118
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-11-18T12:42:58Z: https://ci.nodejs.org/job/node-test-pull-request/79258/
�[36m⠙�[39m Querying data for job/node-test-pull-request/79258/
�[36m⠙�[39m Querying data for job/node-test-pull-request/79258/
�[36m⠙�[39m Querying API for job/node-test-pull-request/79258/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
�[36m⠹�[39m Querying API for job/node-test-pull-request/79258/
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
�[36m⠹�[39m Querying API for job/node-test-pull-request/79258/
�[36m⠹�[39m Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
�[36m⠸�[39m Downloading patch for 67533
�[36m⠸�[39m Downloading patch for 67533
From https://github.com/nodejs/node
 * branch                  refs/pull/67533/merge -> FETCH_HEAD
✔  Fetched commits as ce4426601846..63cd7e39985d
--------------------------------------------------------------------------------
Auto-merging lib/eslint.config_partial.mjs
[main 2a0e83577d] lib: add ERM classes to primordials
 Author: LiviaMedeiros <livia@cirno.name>
 Date: Tue Nov 17 04:05:29 2026 +0800
 4 files changed, 45 insertions(+), 21 deletions(-)
[main 2e6ceedb07] Revert "diagnostics_channel: replace using with try-finally"
 Author: LiviaMedeiros <livia@cirno.name>
 Date: Tue Nov 17 05:53:13 2026 +0800
 1 file changed, 24 insertions(+), 62 deletions(-)
Auto-merging lib/eslint.config_partial.mjs
[main b82d8a1604] diagnostics_channel: use `DisposableStack` primordial
 Author: LiviaMedeiros <livia@cirno.name>
 Date: Tue Nov 17 06:33:45 2026 +0800
 2 files changed, 7 insertions(+), 3 deletions(-)
   ✔  Patches applied
There are 3 commits in the PR. Attempting autorebase.
(node:381) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Rebasing (2/6)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
lib: add ERM classes to primordials

Totes three classes:
- `DisposableStack`
- `AsyncDisposableStack`
- `SuppressedError`

Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67533
Fixes: https://github.com/nodejs/node/pull/67530
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD eda0782225] lib: add ERM classes to primordials
 Author: LiviaMedeiros <livia@cirno.name>
 Date: Tue Nov 17 04:05:29 2026 +0800
 4 files changed, 45 insertions(+), 21 deletions(-)
Rebasing (3/6)
Rebasing (4/6)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
Revert "diagnostics_channel: replace using with try-finally"

This reverts commit b1251217f2d28070fac7497fd600e805faa607dc.

PR-URL: https://github.com/nodejs/node/pull/67533
Fixes: https://github.com/nodejs/node/pull/67530
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD 91b4dc094e] Revert "diagnostics_channel: replace using with try-finally"
 Author: LiviaMedeiros <livia@cirno.name>
 Date: Tue Nov 17 05:53:13 2026 +0800
 1 file changed, 24 insertions(+), 62 deletions(-)
Rebasing (5/6)
Rebasing (6/6)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
diagnostics_channel: use `DisposableStack` primordial

Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67533
Fixes: https://github.com/nodejs/node/pull/67530
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD 7232277701] diagnostics_channel: use `DisposableStack` primordial
 Author: LiviaMedeiros <livia@cirno.name>
 Date: Tue Nov 17 06:33:45 2026 +0800
 2 files changed, 7 insertions(+), 3 deletions(-)
Successfully rebased and updated refs/heads/main.
--------------------------------------------------------------------------------
  ✖  eda07822253bffe92899642ff4be3eecee31b09a
     ✔  0:0      no Assisted-by metadata                   assisted-by-is-trailer
     ✔  0:0      no Co-authored-by metadata                co-authored-by-is-trailer
     ✖  8:7      Pull request URL must reference a comment or discussion. fixes-url
     ✔  0:0      blank line after title                    line-after-title
     ✔  0:0      line-lengths are valid                    line-length
     ✔  0:0      metadata is at end of message             metadata-end
     ✔  7:8      PR-URL is valid.                          pr-url
     ✔  0:0      reviewers are valid                       reviewers
     ✔  0:0      has valid Signed-off-by                   signed-off-by
     ✔  0:0      valid subsystems                          subsystem
     ✔  0:0      Title is formatted correctly.             title-format
     ✔  0:0      Title is <= 50 columns.                   title-length
  ✖  91b4dc094eab1b4cd4af316d9d1e547c22467aa8
     ✔  0:0      no Assisted-by metadata                   assisted-by-is-trailer
     ✔  0:0      no Co-authored-by metadata                co-authored-by-is-trailer
     ✖  4:7      Pull request URL must reference a comment or discussion. fixes-url
     ✔  0:0      blank line after title                    line-after-title
     ✔  0:0      line-lengths are valid                    line-length
     ✔  0:0      metadata is at end of message             metadata-end
     ✔  3:8      PR-URL is valid.                          pr-url
     ✔  0:0      reviewers are valid                       reviewers
     ✖  0:0      Commit must have a "Signed-off-by" trailer signed-off-by
     ✔  0:0      valid subsystems                          subsystem
     ✔  0:0      Title is formatted correctly.             title-format
     ⚠  0:59     Title should be <= 59 columns.            title-length
  ✖  72322777013ff58d10c65e11928ee0fbbf9c16e3
     ✔  0:0      no Assisted-by metadata                   assisted-by-is-trailer
     ✔  0:0      no Co-authored-by metadata                co-authored-by-is-trailer
     ✖  3:7      Pull request URL must reference a comment or discussion. fixes-url
     ✔  0:0      blank line after title                    line-after-title
     ✔  0:0      line-lengths are valid                    line-length
     ✔  0:0      metadata is at end of message             metadata-end
     ✔  2:8      PR-URL is valid.                          pr-url
     ✔  0:0      reviewers are valid                       reviewers
     ✔  0:0      has valid Signed-off-by                   signed-off-by
     ✔  0:0      valid subsystems                          subsystem
     ✔  0:0      Title is formatted correctly.             title-format
     ⚠  0:50     Title should be <= 50 columns.            title-length
   ℹ  Please fix the commit message and try again.
Please manually ammend the commit message, by running
`git commit --amend`
Once commit message is fixed, finish the landing command running
`git node land --continue`

View workflow run

@LiviaMedeiros LiviaMedeiros self-assigned this Nov 21, 2026
LiviaMedeiros added a commit that referenced this pull request Nov 21, 2026
Totes three classes:
- `DisposableStack`
- `AsyncDisposableStack`
- `SuppressedError`

Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: #67533
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
LiviaMedeiros added a commit that referenced this pull request Nov 21, 2026
This reverts commit b125121.

Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: #67533
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
LiviaMedeiros added a commit that referenced this pull request Nov 21, 2026
Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: #67533
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@LiviaMedeiros

Copy link
Copy Markdown
Member Author

Landed in 93078b4...915cf10

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-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. 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.

5 participants