Skip to content

Conversation

@tsctx
Copy link
Member

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

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. web streams labels Dec 12, 2023
@lpincalpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 13, 2023
@github-actionsgithub-actionsbot 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

@aduh95aduh95 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.

@tsctxtsctx changed the title stream: using structuredClone for webstream still terminates processstream: fix deadlock when cloning webstreamsDec 17, 2023
@H4adH4ad 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-actionsgithub-actionsbot 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
MemberAuthor

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

@H4adH4ad 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
MemberAuthor

@H4ad
#49344
#47748

Copy link
Member

@jasnelljasnell 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.

@tsctxtsctx closed this Dec 22, 2023
@tsctxtsctx deleted the stream/using-structuredClone-for-webstream-still-terminates-process branch December 22, 2023 04:41
@H4adH4ad mentioned this pull request Jan 16, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.needs-ciPRs 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

@tsctx@nodejs-github-bot@jasnell@H4ad@aduh95@KhafraDev@lpinca