Release the pipe source when validation fails after locking - #7498
Merged
Merged
Conversation
Contributor
|
LGTM |
guybedford
approved these changes
Sep 24, 2026
guybedford
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Verified the new tests fail on main with the leaked #writer TypeError and pass here across all four piping configs; //src/wpt:streams-ts@ still passes (throwing-options getter order and pipe-through readable-before-writable are unaffected by the reordering).
jasnell
commented
Sep 24, 2026
jasnell
enabled auto-merge (squash)
September 24, 2026 19:00
pipeThrough() took the source's reader before acquiring the writer, and nothing released it if that threw. A non-WritableStream writable, an option getter that locks the destination, or a shadowed `locked` left the source locked, and the first threw "Cannot read private member Both methods now brand-check the destination and convert the options (one shared convertPipeOptions) before the locked checks, as WebIDL does, and check locks internally. pipeToInternal also releases the reader if acquiring the writer throws. Parity with C++. Behind the experimental typescript_implemented_streams flag.
jasnell
force-pushed
the
jasnell/ts-streams-pipethrough-lock-leak
branch
from
September 24, 2026 22:23
4ec30cb to
a8db103
Compare
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.
pipeThrough() took the source's reader before acquiring the writer, and nothing released it if that threw. A non-WritableStream writable, an option getter that locks the destination, or a shadowed
lockedleft the source locked, and the first threw "Cannot read private member #writer". pipeTo() leaked the same way through an option getter.Both methods now brand-check the destination and convert the options (one shared convertPipeOptions) before the locked checks, as WebIDL does, and check locks internally. pipeToInternal also releases the reader if acquiring the writer throws.
Parity with C++. Behind the experimental typescript_implemented_streams flag.