Skip to content

stream: drain pending writes before broadcast end - #65334

Merged
trivikr merged 1 commit into
nodejs:mainfrom
trivikr:stream-iter-bc-end-stranding-writes-2
Aug 23, 2026
Merged

stream: drain pending writes before broadcast end#65334
trivikr merged 1 commit into
nodejs:mainfrom
trivikr:stream-iter-bc-end-stranding-writes-2

Conversation

@trivikr

@trivikr trivikr commented Aug 16, 2026

Copy link
Copy Markdown
Member

Fixes: #65333

Keep processing writes that were queued before end(). Signal the broadcast end only after those writes enter the shared buffer.

Resolve end() after all consumers reach end-of-stream. This prevents backpressured writes from remaining pending forever.


Assisted-by: codex:gpt-5.6-sol

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem. labels Aug 16, 2026
@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 16, 2026
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.04348% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.14%. Comparing base (453f47a) to head (c28857e).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/streams/iter/broadcast.js 88.04% 9 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #65334   +/-   ##
=======================================
  Coverage   90.14%   90.14%           
=======================================
  Files         751      751           
  Lines      252709   252767   +58     
  Branches    47557    47588   +31     
=======================================
+ Hits       227800   227861   +61     
+ Misses      16206    16202    -4     
- Partials     8703     8704    +1     
Files with missing lines Coverage Δ
lib/internal/streams/iter/broadcast.js 88.44% <88.04%> (+0.41%) ⬆️

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

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

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr trivikr added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Aug 23, 2026
Keep processing writes that were queued before end(). Signal the
broadcast end only after those writes enter the shared buffer.

Resolve end() after all consumers reach end-of-stream. This prevents
backpressured writes from remaining pending forever.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: nodejs#65334
Fixes: nodejs#65333
Reviewed-By: James M Snell <jasnell@gmail.com>
@trivikr
trivikr force-pushed the stream-iter-bc-end-stranding-writes-2 branch from 7e864ea to c28857e Compare August 23, 2026 20:26
@trivikr
trivikr merged commit c28857e into nodejs:main Aug 23, 2026
20 checks passed
@trivikr

trivikr commented Aug 23, 2026

Copy link
Copy Markdown
Member Author

Landed in c28857e

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 outstanding review comments, and a CI started. needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stream/iter: BroadcastWriter.end() strands backpressured writes and truncates the broadcast

3 participants