This changeset fixes a potential race condition that may happen for the drain event of ThroughStream. This is more of an edge case when pausing/resuming/closing immediately after flushing any buffers and is unlikely to have significant impact on existing code out in the wild.
The changes look relatively simple, most of the work went into making sure this is fully covered by additional tests for such edge cases. The test suite confirms this does not affect any of the existing behavior, so this should be safe to apply.
This changeset fixes a potential race condition that may happen for the
drain
event ofThroughStream
. This is more of an edge case when pausing/resuming/closing immediately after flushing any buffers and is unlikely to have significant impact on existing code out in the wild.The changes look relatively simple, most of the work went into making sure this is fully covered by additional tests for such edge cases. The test suite confirms this does not affect any of the existing behavior, so this should be safe to apply.