Skip to content

stream: use RangeError for broadcast overflow#64420

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-broadcast-strict-backpressure-overflow
Open

stream: use RangeError for broadcast overflow#64420
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-broadcast-strict-backpressure-overflow

Conversation

@trivikr

@trivikr trivikr commented Jul 11, 2026

Copy link
Copy Markdown
Member

Fixes: #64419

Broadcast writers using the strict backpressure policy currently reject
with ERR_INVALID_STATE as a TypeError when the pending writes queue
overflows.

This change uses ERR_INVALID_STATE.RangeError, matching the existing
push writer behavior, and adds regression coverage for the error type and code.

@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 Jul 11, 2026
@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 11, 2026
Reject strict-backpressure writes with a RangeError when the broadcast
pending writes queue is full.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
@trivikr
trivikr force-pushed the stream-iter-broadcast-strict-backpressure-overflow branch from 46a1376 to e37419d Compare July 11, 2026 07:26
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.26%. Comparing base (6eff679) to head (e37419d).
⚠️ Report is 71 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64420      +/-   ##
==========================================
+ Coverage   90.23%   90.26%   +0.02%     
==========================================
  Files         741      741              
  Lines      241342   241342              
  Branches    45474    45476       +2     
==========================================
+ Hits       217767   217836      +69     
+ Misses      15123    15069      -54     
+ Partials     8452     8437      -15     
Files with missing lines Coverage Δ
lib/internal/streams/iter/broadcast.js 87.48% <100.00%> (+1.52%) ⬆️

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

@bjohansebas bjohansebas 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!

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 19, 2026
@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

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: broadcast strict-backpressure overflow rejects with TypeError instead of RangeError

4 participants