-
Notifications
You must be signed in to change notification settings - Fork 786
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
Async.AwaitTask behaviour on task canceled #1166
Comments
(bump) Any thoughts on this? I could provide a PR if you like. |
What you say is reasonable. It's plain wrong to cancel the whole workflow when
|
type Async with
static member CreateLinkedTokenSource([<ParamArray>]otherTokens:CancellationToken[]) = async {
let! ct = Async.CancellationToken
return CancellationTokenSource.CreateLinkedTokenSource(Array.append [|ct|] otherTokens)
} which generates a new CTS bound to the ambient CT. |
@eiriktsarpalis OK, please submit a PR for this, as far as I'm concerned (from what I've seen so far) we can treat it as a bug fix. |
Closing as it is fixed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reading this stackoverflow issue I was reminded of a peculiar behaviour that the
Async.AwaitTask
method has when the input task has been cancelled. Namely, it will trigger the cancellation continuation of the awaiting workflow, without the possibility of recovery.Here's a simplistic reproduction that demonstrates the behaviour:
I believe that this behaviour is wrong, for a couple of reasons:
My recommendation here would be to amend the implementation of
Async.AwaitTask
so that cancelled tasks should trigger the exception continuation pipeline. This would allow developers to reason about the origin of the problem and potentially prevent catastrophic wipe-outs of execution state.The text was updated successfully, but these errors were encountered: