Skip to content

stream: avoid leaking consumers on signal failure - #65299

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-bc-share-consumer-leak-invalid-signal
Open

stream: avoid leaking consumers on signal failure#65299
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-bc-share-consumer-leak-invalid-signal

Conversation

@trivikr

@trivikr trivikr commented Aug 15, 2026

Copy link
Copy Markdown
Member

Fixes: #65298

Validate Broadcast.push() and Share.pull() signals before registering raw consumers. Return a rejecting iterable for pre-aborted signals without adding a cursor.

This prevents failed subscriptions from leaving unreachable cursors that inflate consumerCount and can permanently impose backpressure.


Assisted-by: codex:gpt-5.6-sol

Validate Broadcast.push() and Share.pull() signals before registering
raw consumers. Return a rejecting iterable for pre-aborted signals
without adding a cursor.

This prevents failed subscriptions from leaving unreachable cursors
that inflate consumerCount and can permanently impose backpressure.

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 15, 2026
@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.32%. Comparing base (4551732) to head (309218d).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65299      +/-   ##
==========================================
+ Coverage   90.30%   90.32%   +0.01%     
==========================================
  Files         751      751              
  Lines      250235   250268      +33     
  Branches    47305    47304       -1     
==========================================
+ Hits       225987   226061      +74     
+ Misses      15619    15578      -41     
  Partials     8629     8629              
Files with missing lines Coverage Δ
lib/internal/streams/iter/broadcast.js 88.02% <100.00%> (+0.20%) ⬆️
lib/internal/streams/iter/share.js 85.80% <100.00%> (+0.32%) ⬆️

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

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

This comment was marked as outdated.

@trivikr trivikr added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 15, 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

author ready PRs that have at least one approval, no pending requests for changes, 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: Broadcast and Share leak consumers for invalid or pre-aborted signals

4 participants