Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream: fix deadlock when cloning webstreams #51131

Closed
wants to merge 1 commit into from
Closed

stream: fix deadlock when cloning webstreams #51131

wants to merge 1 commit into from

Conversation

tsctx
Copy link
Member

@tsctx tsctx commented Dec 12, 2023

Fixes #44985.
Fixed a problem where the process would not terminate if structuredClone was used for webstream and body was not consumed.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. web streams labels Dec 12, 2023
@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 13, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 13, 2023
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you amend the commit message so it matches our guidelines? using is not an imperative verb, I suggest something like stream: fix deadlock when cloning webstreams

* be prefixed with the name of the changed [subsystem](#appendix-subsystems)
and start with an imperative verb. Check the output of `git log --oneline
files/you/changed` to find out what subsystems your changes touch.

@tsctx tsctx changed the title stream: using structuredClone for webstream still terminates process stream: fix deadlock when cloning webstreams Dec 17, 2023
@H4ad H4ad added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Dec 19, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 19, 2023
@nodejs-github-bot
Copy link
Collaborator

@tsctx
Copy link
Member Author

tsctx commented Dec 20, 2023

There seems to be a problem with FinalizationRegistry, so please wait for that to be resolved.

@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@H4ad H4ad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsctx Can you elaborate? (just use request change to block merge)

@tsctx
Copy link
Member Author

tsctx commented Dec 21, 2023

@H4ad
#49344
#47748

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate the work on this but this isn't the correct fix. The issue is the fact that cloned ReadableStream and WritableStream instances use a MessageChannel under the covers to communicate. The MessagePorts for each need to be unref'd in order to allow the process to exit. I'll have an alternative PR opened shortly.

@tsctx tsctx closed this Dec 22, 2023
@tsctx tsctx deleted the stream/using-structuredClone-for-webstream-still-terminates-process branch December 22, 2023 04:41
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. web streams
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: using structuredClone with ReadableStream prevents process from exiting
7 participants