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

Hold strong refs in certain streams Writer/Reader methods #2046

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Apr 22, 2024

In some edge cases, if the Writer/Reader is the only thing remaining holding a strong reference to a WritableStream or ReadableStream, the calls to close(), abort(), cancel(), etc can cause the Writer/Reader to drop it's strong reference in mid operation, leading to issues. Let's defensively hold an additional strong reference while the operations are pending

@jasnell jasnell requested review from a team as code owners April 22, 2024 23:10
@jasnell jasnell requested review from mikea and Warfields April 22, 2024 23:10
@jasnell

This comment was marked as resolved.

In some edge cases, if the Writer/Reader is the only thing remaining
holding a strong reference to a WritableStream or ReadableStream,
the calls to `close()`, `abort()`, `cancel()`, etc can cause the
Writer/Reader to drop it's strong reference in mid operation, leading
to issues. Let's defensively hold an additional strong reference while
the operations are pending
@jasnell jasnell force-pushed the jsnell/hold-strongref-in-writer-reader branch from 44a9b03 to adc8f24 Compare April 23, 2024 00:27
@harrishancock harrishancock merged commit 03e24eb into main Apr 23, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants