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.08%. Comparing base (705646f) to head (acf4fe4).
⚠️ Report is 8 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.07%   90.08%            
========================================
  Files         754      754            
  Lines      256395   256653   +258     
  Branches    48499    48567    +68     
========================================
+ Hits       230937   231194   +257     
- Misses      16569    16572     +3     
+ Partials     8889     8887     -2     
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 31 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

This comment was marked as outdated.

@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
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
@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 30, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 30, 2026
@nodejs-github-bot

This comment was marked as outdated.

@jasnell jasnell added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Aug 30, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@jasnell
jasnell force-pushed the jasnell/stream-iter-fixes branch from 06d1687 to 5943deb Compare August 31, 2026 15:15
@nodejs-github-bot

This comment was marked as outdated.

@jasnell
jasnell force-pushed the jasnell/stream-iter-fixes branch from 5943deb to 540f9ec Compare August 31, 2026 15:50
@nodejs-github-bot

This comment was marked as outdated.

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

RSLGTM

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 540f9ec to acf4fe4 Compare August 31, 2026 23:12
@nodejs-github-bot

This comment was marked as outdated.

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

This comment was marked as outdated.

@jasnell

This comment was marked as resolved.

@nodejs-github-bot

This comment was marked as outdated.

@trivikr

This comment was marked as resolved.

@jasnell

This comment was marked as resolved.

@jasnell

jasnell commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Let's see if we can get this landed in fewer than a dozen more CI runs

@nodejs-github-bot

This comment was marked as outdated.

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

4 participants