streams: fix cloned webstreams not being unref'd#51255
Merged
nodejs-github-bot merged 2 commits intonodejs:mainfrom Dec 24, 2023
Merged
streams: fix cloned webstreams not being unref'd#51255nodejs-github-bot merged 2 commits intonodejs:mainfrom
nodejs-github-bot merged 2 commits intonodejs:mainfrom
Conversation
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
Member
|
Thank you! |
299f752 to
2ac4765
Compare
Collaborator
Collaborator
apapirovski
reviewed
Dec 22, 2023
jasnell
commented
Dec 22, 2023
KhafraDev
approved these changes
Dec 22, 2023
Member
KhafraDev
left a comment
There was a problem hiding this comment.
this will hopefully fix a few issues in fetch.
mcollina
approved these changes
Dec 23, 2023
Member
mcollina
left a comment
There was a problem hiding this comment.
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?
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/.ncuhttps://github.com/nodejs/node/actions/runs/7312493372 |
Collaborator
Collaborator
debadree25
approved these changes
Dec 24, 2023
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>
Merged
This was referenced Jan 16, 2024
Closed
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
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.
When cloning a
ReadableStreamandWritableStream, both use an internalMessageChannelto 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).