Open
Description
Steps to reproduce:
val channel = Channel<Int>()
launch {
channel.send(1)
}
yield()
channel.close(RuntimeException("Failure"))
channel.cancel()
When the racing cancel
comes to the channel that was correctly closed with an exception in order to propagate it to receivers, cancel
has to wake up and cancel all the senders with an exception.
The problem is that cancel
uses closing cause as an exception, triggering cascading failure on the sending side, even though the sending side correctly closed the channel and stopped all the consecutive sends.