From 884ca5c3f5e0604005b1078850eb863ea7751e8f Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Fri, 29 Sep 2023 13:37:15 +0400 Subject: [PATCH] Worker: do not report the task as failed if it's context was canceled (#654) --- 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)