Skip to content

stream: drain pending writes before broadcast end - #65334

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-bc-end-stranding-writes-2
Open

stream: drain pending writes before broadcast end#65334
trivikr wants to merge 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

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
@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.12%. Comparing base (ad7a5b8) to head (7e864ea).

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.11%   90.12%           
=======================================
  Files         752      752           
  Lines      251569   251627   +58     
  Branches    47268    47288   +20     
=======================================
+ Hits       226701   226771   +70     
+ Misses      16233    16215   -18     
- Partials     8635     8641    +6     
Files with missing lines Coverage Δ
lib/internal/streams/iter/broadcast.js 88.25% <88.04%> (+0.43%) ⬆️

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

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

Labels

needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR. 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

2 participants