square / okio

A modern I/O library for Android, Java, and Kotlin Multiplatform.
https://square.github.io/okio/
Apache License 2.0
8.72k stars 1.17k forks source link

Pipe.fold: destination sink can remain open even after pipe closed #1412

Closed jhump closed 5 months ago

jhump commented 5 months ago

If a call to Pipe.sink.close() is invoked concurrently while Pipe.fold() is running, it can be missed by the folding thread, leaving the fold destination open, even though it should be closed. Depending on how the sink is used, this can lead to deadlock or slowness and timeout failures.

jhump commented 5 months ago

@swankjesse, thanks for reviewing and merging that PR! Any ideas on when this bugfix can expect to appear in a released (non-snapshot) version?

swankjesse commented 5 months ago

@jhump Lemme try to land something by the end of the week!