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

go: doltcore/remotestorage: reliable: Fix leaked goroutines when the context is canceled while reading the HTTP response. #8378

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

reltuk
Copy link
Contributor

@reltuk reltuk commented Sep 24, 2024

io.Copy into an io.PipeWriter will block until all the bytes have been delivered or the reader is closed. reliable/http StreamingResponse was constructed to only cancel the request context on Close(), not also clear the Reader. The Reader should also be closed to ensure all finalization can still happen if the Write to the PipeWriter is currently blocked when the context is canceled.

reltuk and others added 2 commits September 24, 2024 06:50
…context is canceled while reading the HTTP response.

io.Copy into an io.PipeWriter will block until all the bytes have been
delivered or the reader is closed. reliable/http StreamingResponse was
constructed to only cancel the request context on Close(), not also clear the
Reader. The Reader should also be closed to ensure all finalization can still
happen if the Write to the PipeWriter is currently blocked when the context is
canceled.
@coffeegoddd
Copy link
Contributor

@reltuk DOLT

comparing_percentages
100.000000 to 100.000000
version result total
a27cc9b ok 5937457
version total_tests
a27cc9b 5937457
correctness_percentage
100.0

@coffeegoddd
Copy link
Contributor

@coffeegoddd DOLT

comparing_percentages
100.000000 to 100.000000
version result total
4a6db7e ok 5937457
version total_tests
4a6db7e 5937457
correctness_percentage
100.0

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@reltuk reltuk merged commit f4c9dc4 into main Sep 24, 2024
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants