Skip to content

vfs: fix VirtualReadStream race with async iteration#64394

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
Y1D7NG:fix-vfs-readstream-construct
Jul 16, 2026
Merged

vfs: fix VirtualReadStream race with async iteration#64394
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
Y1D7NG:fix-vfs-readstream-construct

Conversation

@Y1D7NG

@Y1D7NG Y1D7NG commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Fixes: #64377

VirtualReadStream opened files on the next tick without _construct, so for-await and pipeline could read before the fd was ready and fail with EBADF. Open the virtual file in _construct instead, matching fs.ReadStream.

Fixes: nodejs#64377
Signed-off-by: y1d7ng <y1d7ng@yeah.net>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. vfs Issues and PRs related to the virtual filesystem subsystem. labels Jul 9, 2026
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.25%. Comparing base (8fec65d) to head (31569ec).
⚠️ Report is 58 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #64394   +/-   ##
=======================================
  Coverage   90.25%   90.25%           
=======================================
  Files         741      741           
  Lines      241207   241196   -11     
  Branches    45430    45436    +6     
=======================================
- Hits       217698   217693    -5     
+ Misses      15084    15071   -13     
- Partials     8425     8432    +7     
Files with missing lines Coverage Δ
lib/internal/vfs/streams.js 95.32% <100.00%> (-0.15%) ⬇️

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

@jasnell
jasnell requested a review from mcollina July 12, 2026 14:48

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

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 12, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 12, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr trivikr added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 12, 2026
@bjohansebas bjohansebas added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 16, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 16, 2026
@nodejs-github-bot
nodejs-github-bot merged commit a27fe21 into nodejs:main Jul 16, 2026
84 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in a27fe21

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. vfs Issues and PRs related to the virtual filesystem subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VirtualReadStream does not work with pipeline from node:stream/promises

6 participants