From 1210a605028ca54e949445c727faa86853219b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gurhem?= Date: Fri, 12 Apr 2024 09:08:20 +0200 Subject: [PATCH 1/2] fix: abort results when cancelling tasks --- Common/src/gRPC/Services/GrpcTasksService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Common/src/gRPC/Services/GrpcTasksService.cs b/Common/src/gRPC/Services/GrpcTasksService.cs index 2f4a25587..6866a7465 100644 --- a/Common/src/gRPC/Services/GrpcTasksService.cs +++ b/Common/src/gRPC/Services/GrpcTasksService.cs @@ -288,6 +288,14 @@ await ownerPodIds.ParallelForEach(new ParallelTaskOptions(10), ? System.Threading.Tasks.Task.CompletedTask : httpClient_.GetAsync("http://" + ownerPodId + ":1080/stopcancelledtask")).ConfigureAwait(false)) .ConfigureAwait(false); + + await ResultLifeCycleHelper.AbortTasksAndResults(taskTable_, + resultTable_, + request.TaskIds, + "Client requested cancellation", + context.CancellationToken) + .ConfigureAwait(false); + return new CancelTasksResponse { Tasks = From 1f66387b2bd5f6a7df38f55cd2fea14360471d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gurhem?= <88328270+aneojgurhem@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:30:31 +0200 Subject: [PATCH 2/2] Add suggestion Co-authored-by: lemaitre-aneo <91961298+lemaitre-aneo@users.noreply.github.com> --- Common/src/gRPC/Services/GrpcTasksService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/gRPC/Services/GrpcTasksService.cs b/Common/src/gRPC/Services/GrpcTasksService.cs index 6866a7465..43494878e 100644 --- a/Common/src/gRPC/Services/GrpcTasksService.cs +++ b/Common/src/gRPC/Services/GrpcTasksService.cs @@ -292,7 +292,7 @@ await ownerPodIds.ParallelForEach(new ParallelTaskOptions(10), await ResultLifeCycleHelper.AbortTasksAndResults(taskTable_, resultTable_, request.TaskIds, - "Client requested cancellation", + $"Client requested cancellation of tasks {string.Join(", ", request.TaskIds)}", context.CancellationToken) .ConfigureAwait(false);