Skip to content

stream: fix pipeline function tail deadlock - #65559

Open
dayun6530 wants to merge 1 commit into
nodejs:mainfrom
dayun6530:fix/stream-pipeline-readable-tail
Open

stream: fix pipeline function tail deadlock#65559
dayun6530 wants to merge 1 commit into
nodejs:mainfrom
dayun6530:fix/stream-pipeline-readable-tail

Conversation

@dayun6530

Copy link
Copy Markdown
Contributor

Fixes: #40685

When the final pipeline entry is a function, pipelineImpl() creates an
internal PassThrough proxy. In the promise-based pipeline API, that proxy
is not exposed to the user, so its readable side can remain unconsumed.

Once the proxy buffer reaches its high water mark, backpressure prevents
the pipeline from completing and the returned promise never resolves.

Resume the internal proxy when the final pipeline entry is a function.
This also handles the array form of pipeline() while preserving the
existing behavior for user-provided destination streams.

Tests:

  • ./node test/parallel/test-stream-pipeline.js
  • make lint

Signed-off-by: Dayun <dlekdbs6530@gmail.com>
@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 26, 2026
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.07%. Comparing base (7b6b21a) to head (90231b2).
⚠️ Report is 30 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65559      +/-   ##
==========================================
+ Coverage   90.05%   90.07%   +0.01%     
==========================================
  Files         751      751              
  Lines      254420   254430      +10     
  Branches    47975    47981       +6     
==========================================
+ Hits       229121   229169      +48     
+ Misses      16483    16437      -46     
- Partials     8816     8824       +8     
Files with missing lines Coverage Δ
lib/stream/promises.js 100.00% <100.00%> (ø)

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

@daeyeon daeyeon added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no outstanding review comments, and a CI started. labels Aug 27, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 27, 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 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.

pipeline deadlock with readable tail?

4 participants