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

Observe discarded ping task results #6577

Merged
merged 1 commit into from
Jun 6, 2020
Merged

Conversation

pentp
Copy link
Contributor

@pentp pentp commented Jun 4, 2020

Always observe ping task results, even if they are discarded (canceled).

@@ -31,7 +31,7 @@ public static void Ignore(this Task task)
task.ContinueWith(
IgnoreTaskContinuation,
CancellationToken.None,
TaskContinuationOptions.NotOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously,
TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid running the continuation if the task is canceled, just more optimal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran some tests and the behavior seems fine

@ReubenBond ReubenBond merged commit 962b3f8 into dotnet:master Jun 6, 2020
@ReubenBond
Copy link
Member

Thank you, Pent!

@pentp pentp deleted the unobserved-ping branch June 6, 2020 19:28
sergeybykov pushed a commit that referenced this pull request Jun 30, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants