Skip to content
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

Ensure that PipeTo supports Task cancellations #3320

Closed
Horusiath opened this issue Feb 9, 2018 · 1 comment
Closed

Ensure that PipeTo supports Task cancellations #3320

Horusiath opened this issue Feb 9, 2018 · 1 comment

Comments

@Horusiath
Copy link
Contributor

Horusiath commented Feb 9, 2018

At this moment our PipeTo support scenarios of failed or succeed task execution. However it turned out, that it may not work when a Task is being cancelled - the code in theory should work, however in practice it may not be the case.

We need tests in PipeToSupportSpec which will confirm that task cancellation is handled correctly.

Also another matter - something to discuss about - is what the correct behavior should be in case if this case is not handled at this moment.

  1. As @OnurGumus in case of cancellation task.Exception can be null. I this is the only case (I haven't heard about the case when task.IsFailed is true and no exception has been provided), we could propagate null exception and i.e. add IsCancelled property to Status.Failure.
  2. We could explicitly convert null exceptions to OperationCancelledException and forward it to failure case of PipeTo method. Afaik this is the closest to actual JVM Akka behavior - Akka Futures don't have cancellations, but if future times out a Status.Failure with TimeOutException is returned.
  3. We can also add third case (like Status.Cancelled), however I'm afraid that this will increase complexity of the overall solution.
@Aaronontheweb
Copy link
Member

Believe this has been resolved via #5123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants