Skip to content

stream: apply multiple stream/iter fixes - #65652

Open
jasnell wants to merge 11 commits into
nodejs:mainfrom
jasnell:jasnell/stream-iter-fixes
Open

stream: apply multiple stream/iter fixes#65652
jasnell wants to merge 11 commits into
nodejs:mainfrom
jasnell:jasnell/stream-iter-fixes

Conversation

@jasnell

@jasnell jasnell commented Aug 30, 2026

Copy link
Copy Markdown
Member

Nine commits, nine issues:

  1. pull() cancellation cannot preempt a pending next()
  2. transformed push, broadcast, and share consumers leak their underlying side
  3. terminating a push consumer can make writer.end() hang forever
  4. byte-budget accounting is derived from mutable data
  5. writev() can resolve after losing the entire outer write
  6. DuplexChannel close() does not close an unread incoming direction
  7. merge() mishandles arbitrary errors and can block error propagation forever
  8. Share cancellation cannot interrupt the pull owner
  9. pipeToSync() starts asynchronous close work that nobody can observe

Recommend reviewing each commit separately.

Plus one minor cleanup commit.

@jasnell
jasnell requested review from mcollina, ronag and trivikr August 30, 2026 00:58
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Aug 30, 2026
@nodejs-github-bot

This comment was marked as outdated.

@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.53472% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.05%. Comparing base (bb5cffc) to head (06d1687).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/streams/iter/broadcast.js 80.28% 14 Missing ⚠️
lib/internal/streams/iter/push.js 87.09% 9 Missing and 3 partials ⚠️
lib/internal/streams/iter/pull.js 95.15% 8 Missing ⚠️
lib/internal/streams/iter/share.js 91.78% 6 Missing ⚠️
lib/internal/streams/iter/consumers.js 97.05% 2 Missing ⚠️
lib/internal/streams/iter/duplex.js 97.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65652      +/-   ##
==========================================
- Coverage   90.06%   90.05%   -0.01%     
==========================================
  Files         754      754              
  Lines      255747   256005     +258     
  Branches    48318    48390      +72     
==========================================
+ Hits       230327   230544     +217     
- Misses      16550    16564      +14     
- Partials     8870     8897      +27     
Files with missing lines Coverage Δ
lib/internal/streams/iter/utils.js 99.11% <100.00%> (+0.87%) ⬆️
lib/internal/streams/iter/duplex.js 97.39% <97.50%> (+1.04%) ⬆️
lib/internal/streams/iter/consumers.js 96.76% <97.05%> (+0.13%) ⬆️
lib/internal/streams/iter/share.js 87.38% <91.78%> (+0.96%) ⬆️
lib/internal/streams/iter/pull.js 83.96% <95.15%> (+0.61%) ⬆️
lib/internal/streams/iter/push.js 91.28% <87.09%> (-0.20%) ⬇️
lib/internal/streams/iter/broadcast.js 88.56% <80.28%> (+0.12%) ⬆️

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

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr trivikr added the commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. label Aug 30, 2026
Comment thread lib/internal/streams/iter/duplex.js
Comment thread lib/internal/streams/iter/consumers.js Outdated
jasnell added 11 commits August 30, 2026 19:55
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
@jasnell
jasnell force-pushed the jasnell/stream-iter-fixes branch from 23b211e to 06d1687 Compare August 30, 2026 19:55
@jasnell
jasnell requested a review from trivikr August 30, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants