GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream: settle pending stream iter reads on return by trivikr · Pull Request #63521 · nodejs/node

Conversation

@trivikr

@trivikr trivikr commented May 23, 2026

Copy link
Copy Markdown
Member

This updates stream/iter cleanup so pending next() calls are settled when
a consumer calls return().

Previously, push() and broadcast() could leave a pending next() promise
unresolved if return() was called before any chunk was written. The cleanup
paths now resolve those pending reads with { done: true, value: undefined }.

Regression coverage was added for both push() and broadcast().

Fixes: #63519


Assisted-by: openai:gpt-5.5

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot

nodejs-github-bot commented May 23, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to Node.js streams. labels May 23, 2026
@codecov

codecov Bot commented May 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.50000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.31%. Comparing base (8257091) to head (f4a87a4).

Files with missing lines Patch % Lines
lib/internal/streams/iter/push.js 28.57% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63521      +/-   ##
==========================================
- Coverage   90.32%   90.31%   -0.01%     
==========================================
  Files         730      730              
  Lines      234671   234679       +8     
  Branches    43946    43950       +4     
==========================================
- Hits       211965   211954      -11     
- Misses      14423    14436      +13     
- Partials     8283     8289       +6     
Files with missing lines Coverage Δ
lib/internal/streams/iter/broadcast.js 85.25% <100.00%> (+0.01%) ⬆️
lib/internal/streams/iter/push.js 91.00% <28.57%> (-0.58%) ⬇️

... and 29 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label May 23, 2026
jasnell
jasnell reviewed May 23, 2026
View reviewed changes
Comment thread lib/internal/streams/iter/push.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes May 23, 2026
View reviewed changes
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label May 23, 2026
@nodejs-github-bot

nodejs-github-bot commented May 23, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/73637/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trivikr trivikr added author ready PRs with CI started, the required approvals, and no outstanding review comments. and removed author ready PRs with CI started, the required approvals, and no outstanding review comments. labels May 24, 2026
@trivikr trivikr mentioned this pull request May 24, 2026
tools: enforce iterator result property order #63526
Merged
@trivikr

This comment was marked as outdated.

Sign in to view
@trivikr
trivikr marked this pull request as draft May 24, 2026 04:19
@trivikr
trivikr marked this pull request as ready for review May 26, 2026 17:22
@trivikr trivikr added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. author ready PRs with CI started, the required approvals, and no outstanding review comments. labels May 27, 2026
trivikr and others added 2 commits May 27, 2026 08:39
@trivikr
stream: settle pending stream iter reads on return
d513365
Resolve pending next() calls when stream/iter push and broadcast
consumers are returned, so the promises do not remain pending after
iterator cleanup.

Fixes: nodejs#63519

Signed-off-by: Kamat, Trivikram <[email protected]>
Assisted-by: openai:gpt-5.5
@trivikr @jasnell
stream: swap done and value while resolving pending reads
f4a87a4
Co-authored-by: James M Snell <[email protected]>
@trivikr
trivikr force-pushed the stream-iter-pending-next-hang branch from 4c2a5f1 to f4a87a4 Compare May 27, 2026 16:02
@trivikr
trivikr marked this pull request as draft May 27, 2026 17:19
@trivikr

trivikr commented May 28, 2026

Copy link
Copy Markdown
Member Author

The bug in push was fixed in #63555, when fixing for iterator.throw()

I posted a new broadcast only specific PR at #63603

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trivikr trivikr closed this May 28, 2026
@trivikr
trivikr deleted the stream-iter-pending-next-hang branch May 28, 2026 00:35
@trivikr trivikr mentioned this pull request Oct 19, 2026
lib: place value before done in iterator results #66837
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. stream Issues and PRs related to Node.js streams.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

stream/iter: pending next() hangs after iterator return()

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@trivikr @nodejs-github-bot @jasnell
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.