-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ClosedSendChannelException still confusing #957
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
Comments
It is because the channel is closed with But you are right, this behaviour is misleading and may lead to subtle bugs, I will investigate possibilities to change this |
Thanks in advance! I assume there is a reason why |
elizarov
added a commit
that referenced
this issue
Apr 30, 2019
* ReceiveChannel.cancel always closes channel with CancellationException, so sending or receiving from a cancelled channel produces the corresponding CancellationException. * Cancelling produce builder has similar effect, but an more specific instance of JobCancellationException is created. * This ensure that produce/consumeEach pair is transparent with respect to cancellation and can be used to build "identity" transformation of the flow (the corresponding test is added). * ClosedSendChannelException is now a subclass of IllegalStateException, so that trying to send to a channel that was closed normally is reported as program error and is not eaten (test is added). Fixes #957 Fixes #1128
This was referenced Apr 30, 2019
elizarov
added a commit
that referenced
this issue
Apr 30, 2019
* ReceiveChannel.cancel always closes channel with CancellationException, so sending or receiving from a cancelled channel produces the corresponding CancellationException. * Cancelling produce builder has similar effect, but an more specific instance of JobCancellationException is created. * This ensure that produce/consumeEach pair is transparent with respect to cancellation and can be used to build "identity" transformation of the flow (the corresponding test is added). * ClosedSendChannelException is now a subclass of IllegalStateException, so that trying to send to a channel that was closed normally is reported as program error and is not eaten (test is added). Fixes #957 Fixes #1128
elizarov
added a commit
that referenced
this issue
Apr 30, 2019
* ReceiveChannel.cancel always closes channel with CancellationException, so sending or receiving from a cancelled channel produces the corresponding CancellationException. * Cancelling produce builder has similar effect, but an more specific instance of JobCancellationException is created. * This ensure that produce/consumeEach pair is transparent with respect to cancellation and can be used to build "identity" transformation of the flow (the corresponding test is added). * ClosedSendChannelException is now a subclass of IllegalStateException, so that trying to send to a channel that was closed normally is reported as program error and is not eaten (test is added). Fixes #957 Fixes #1128
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#422 solved the issue for actors, but when using
launch
, the exception is still swallowed:output:
The text was updated successfully, but these errors were encountered: