stream: fix deadlock when cloning webstreams#51131
stream: fix deadlock when cloning webstreams#51131tsctx wants to merge 1 commit intonodejs:mainfrom tsctx:stream/using-structuredClone-for-webstream-still-terminates-process
Conversation
aduh95
left a comment
There was a problem hiding this comment.
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
node/doc/contributing/pull-requests.md
Lines 170 to 172 in 1149d6b
test/parallel/test-webstreams-using-structuredclone-exit-process.js
Outdated
Show resolved
Hide resolved
test/parallel/test-webstreams-using-structuredclone-exit-process.js
Outdated
Show resolved
Hide resolved
test/parallel/test-webstreams-using-structuredclone-exit-process.js
Outdated
Show resolved
Hide resolved
test/parallel/test-webstreams-using-structuredclone-exit-process.js
Outdated
Show resolved
Hide resolved
|
There seems to be a problem with FinalizationRegistry, so please wait for that to be resolved. |
jasnell
left a comment
There was a problem hiding this comment.
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.
Fixes #44985.
Fixed a problem where the process would not terminate if structuredClone was used for webstream and body was not consumed.