When a yamux channel is reset, the connection may still be in use with pending writes. In that situation, the socket cannot be used to send the terminating {Rst} packet without corrupting the data. Waiting for the pending write to complete is also not too useful, and also would need a refactoring to even support so, as we don't track the trySend future that is currently writing, and also already purged the sendQueue.
Note that this also fixes assertions depending on chronos scheduling in local tests that use pushData on BufferStream. Because pushData checks no other pushes are in progress, tests may have randomly failed.
When a yamux channel is reset, the connection may still be in use with pending writes. In that situation, the socket cannot be used to send the terminating
{Rst}
packet without corrupting the data. Waiting for the pending write to complete is also not too useful, and also would need a refactoring to even support so, as we don't track thetrySend
future that is currently writing, and also already purged thesendQueue
.Note that this also fixes assertions depending on chronos scheduling in local tests that use
pushData
onBufferStream
. BecausepushData
checks no other pushes are in progress, tests may have randomly failed.