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

Ignore OperationCanceledException in SafeTask #2140

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Proto.Actor/Utils/TaskFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class SafeTask
private static readonly ILogger Logger = Log.CreateLogger<TaskFactory>();

/// <summary>
/// Runs a task and handles exceptions. If <see cref="TaskCanceledException" /> is thrown, it is ignored.
/// Runs a task and handles exceptions. If <see cref="TaskCanceledException" /> or <see cref="OperationCanceledException"/> is thrown, it is ignored.
/// If any other exception is thrown, it is logged.
/// </summary>
/// <param name="body"></param>
Expand All @@ -34,6 +34,10 @@ public static async Task Run(Func<Task> body, CancellationToken cancellationToke
{
// Pass. Do not log when the task is canceled.
}
catch (OperationCanceledException)
{
// Pass. Do not log when the operation is canceled.
}
catch (Exception x)
{
x.CheckFailFast();
Expand Down
Loading