From 37d722496373b3befcdfdfa3c214c2ae30cb79b4 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Fri, 29 Sep 2023 13:13:13 +0400 Subject: [PATCH] Worker: do not report the task as failed if it's context was canceled --- internal/worker/task.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/worker/task.go b/internal/worker/task.go index 66c147cd..9f621ba1 100644 --- a/internal/worker/task.go +++ b/internal/worker/task.go @@ -112,7 +112,7 @@ func (worker *Worker) runTask( err := inst.Run(taskCtx, &config) - if err != nil && !errors.Is(err, context.Canceled) { + if err != nil && !errors.Is(err, context.Canceled) && !errors.Is(taskCtx.Err(), context.Canceled) { worker.logger.Errorf("failed to run task %d: %v", agentAwareTask.TaskId, err) boundedCtx, cancel := context.WithTimeout(context.Background(), perCallTimeout)