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

Cleanup PumpToReader further #355

Merged
merged 1 commit into from
Feb 9, 2023
Merged

Cleanup PumpToReader further #355

merged 1 commit into from
Feb 9, 2023

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Feb 8, 2023

The ownership semantics of PumpToReader are complex.

The PumpToReader instance is a kj heap object attached to the kj
promise for the pump. The PumpToReader owns the destination sink.
If the promise is dropped, the PumpToReader is dropped, and the
sink goes away.

However, the reader side is owned by JavaScript, and is not directly
canceled if the kj promise is dropped. When a read completes, the
PumpToReader may have already been freed.
@jasnell jasnell merged commit 1a3bb87 into main Feb 9, 2023
@jasnell jasnell deleted the jsnell/pumptoreader-cleanup branch February 9, 2023 13:14
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