FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

streams: fix cloned webstreams not being unref'd by jasnell · Pull Request #51255 · nodejs/node · GitHub

/ node Public

streams: fix cloned webstreams not being unref'd - #51255

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
jasnell:fixup-webstreams-clone-hang
Dec 24, 2023
Merged

streams: fix cloned webstreams not being unref'd#51255
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
jasnell:fixup-webstreams-clone-hang

Conversation

jasnell commented Dec 22, 2023
edited
Loading

Copy link
Copy Markdown
Member

When cloning a ReadableStream and WritableStream, both use an internal MessageChannel to communicate with the original stream. Those, however, previously were not unref'd which would lead to the process not exiting if the stream was not fully consumed.

Alternative for: #51131

Fixes: #44985

Semver-major because this can change whether a worker thread stays alive solely because of the existence of the cloned streams vs. needing something else to keep it alive (see the modified test in this PR for instance).

When cloning a `ReadableStream` and `WritableStream`, both use an
internal `MessageChannel` to communicate with the original stream.
Those, however, previously were not unref'd which would lead to the
process not exiting if the stream was not fully consumed.

Fixes: nodejs#44985
jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Dec 22, 2023
nodejs-github-bot added needs-ci PRs that need a full CI run. web streams labels Dec 22, 2023

tsctx commented Dec 22, 2023

Copy link
Copy Markdown
Member

Thank you!

jasnell added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 22, 2023
jasnell force-pushed the fixup-webstreams-clone-hang branch from 299f752 to 2ac4765 Compare December 22, 2023 04:49
jasnell added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Dec 22, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 22, 2023

Copy link
Copy Markdown
Collaborator

nodejs-github-bot commented Dec 22, 2023
edited by jasnell
Loading

Copy link
Copy Markdown
Collaborator

jasnell requested review from mcollina and ronag December 22, 2023 15:00

KhafraDev 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

this will hopefully fix a few issues in fetch.

jasnell requested a review from anonrig December 22, 2023 15:56

mcollina 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm, but I would really consider this a bugfix rather than a semver-major change.

How about we tag it as "baking for lts" instead and wait if we actually break folks?

jasnell added semver-major PRs that contain breaking changes and should be released in the next major version. baking-for-lts PRs that need to wait before landing in a LTS release. author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. and removed semver-major PRs that contain breaking changes and should be released in the next major version. needs-ci PRs that need a full CI run. labels Dec 23, 2023
nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Dec 24, 2023

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/51255
✔  Done loading data for nodejs/node/pull/51255
----------------------------------- PR info ------------------------------------
Title      streams: fix cloned webstreams not being unref'd (#51255)
Author     James M Snell  (@jasnell)
Branch     jasnell:fixup-webstreams-clone-hang -> nodejs:main
Labels     baking-for-lts, author ready, web streams
Commits    2
 - stream: fix cloned webstreams not being unref'd
 - Update test/parallel/test-whatwg-webstreams-transfer.js
Committers 2
 - James M Snell 
 - GitHub 
PR-URL: https://github.com/nodejs/node/pull/51255
Fixes: https://github.com/nodejs/node/issues/44985
Reviewed-By: Matthew Aitken 
Reviewed-By: Matteo Collina 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/51255
Fixes: https://github.com/nodejs/node/issues/44985
Reviewed-By: Matthew Aitken 
Reviewed-By: Matteo Collina 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Fri, 22 Dec 2023 04:21:41 GMT
   ✔  Approvals: 2
   ✔  - Matthew Aitken (@KhafraDev): https://github.com/nodejs/node/pull/51255#pullrequestreview-1794662152
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/51255#pullrequestreview-1795456690
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2023-12-22T08:53:12Z: https://ci.nodejs.org/job/node-test-pull-request/56461/
   ⚠  Commits were pushed after the last Full PR CI run:
   ⚠  - Update test/parallel/test-whatwg-webstreams-transfer.js
- Querying data for job/node-test-pull-request/56461/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/7312493372

mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 24, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 24, 2023

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

mcollina added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Dec 24, 2023
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 24, 2023
nodejs-github-bot merged commit 4d3923a into nodejs:main Dec 24, 2023

Copy link
Copy Markdown
Collaborator

Landed in 4d3923a

RafaelGSS pushed a commit that referenced this pull request Jan 2, 2024
When cloning a `ReadableStream` and `WritableStream`, both use an
internal `MessageChannel` to communicate with the original stream.
Those, however, previously were not unref'd which would lead to the
process not exiting if the stream was not fully consumed.

Fixes: #44985
PR-URL: #51255
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
RafaelGSS mentioned this pull request Jan 2, 2024
richardlau added dont-land-on-v18.x and removed baking-for-lts PRs that need to wait before landing in a LTS release. labels Jan 16, 2024

Copy link
Copy Markdown
Member

This is being reverted by #51491 so adding dont-land labels.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. web streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: using structuredClone with ReadableStream prevents process from exiting

8 participants


Back | FazBrowse Home | New Git URL