Skip to content

fs: use try...finally for abort race - #67545

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
Renegade334:fs-avoid-using
Nov 19, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
Renegade334:fs-avoid-using

Conversation

@Renegade334

Copy link
Copy Markdown
Member

As per #64230. try...finally provides identical semantics here (the disposer from addAbortListener() does not throw) but avoids the dependence on the flagged language feature in release branches prior to v27.x.

Signed-off-by: Renegade334 <rene@renegade334.me.uk>
@Renegade334
Renegade334 requested a review from aduh95 November 17, 2026 14:45
@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. labels Nov 17, 2026
@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.68%. Comparing base (1969a5e) to head (003383b).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67545      +/-   ##
==========================================
- Coverage   92.71%   90.68%   -2.04%     
==========================================
  Files         430      800     +370     
  Lines      196040   280935   +84895     
  Branches    30067    54281   +24214     
==========================================
+ Hits       181757   254754   +72997     
- Misses      13956    16263    +2307     
- Partials      327     9918    +9591     
Files with missing lines Coverage Δ
lib/internal/fs/promises.js 91.79% <100.00%> (+2.46%) ⬆️

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

@LiviaMedeiros LiviaMedeiros 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.

IMHO this should be dont-land-on-v27.x+, i.e. opened against previous release lines while main can move forward using using.

LGTM if the plan is to land this as is (backportable) and immediately revert (non-backportable) on main.

@Renegade334

Renegade334 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member Author

IMHO this should be dont-land-on-v27.x+, i.e. opened against previous release lines while main can move forward using using.

This is one of those cases where there simply isn't any practical advantage beyond code brevity. It doesn't change the behaviour at all here. Keeping PRs landable across multiple release lines is a much greater advantage.

Agree that ultimately we can migrate all of these cases, but there are dozens across the codebase doing no harm to be left alone for now.

@Renegade334 Renegade334 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

@gurgunday gurgunday 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

@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

nodejs-github-bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

@Renegade334 Renegade334 added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 17, 2026
@nodejs-github-bot
nodejs-github-bot merged commit c91d8aa into nodejs:main Nov 19, 2026
80 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in c91d8aa

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 19, 2026
@Renegade334
Renegade334 deleted the fs-avoid-using branch November 19, 2026 15:13
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. fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants