diff --git a/pkg/disttask/framework/taskexecutor/task_executor.go b/pkg/disttask/framework/taskexecutor/task_executor.go index 688f99220adc7..da41ca4135a79 100644 --- a/pkg/disttask/framework/taskexecutor/task_executor.go +++ b/pkg/disttask/framework/taskexecutor/task_executor.go @@ -388,7 +388,13 @@ func (e *BaseTaskExecutor) Run() { // task executor keeps running its subtasks even though some subtask // might have failed, we rely on scheduler to detect the error, and // notify task executor or manager to cancel. - e.sampleLogger.Error("run subtask failed", zap.Error(err)) + if llog.IsContextCanceledError(err) { + // Context canceled is expected when scheduler/manager cancels executor, + // so log as info instead of a subtask failure. + e.sampleLogger.Info("subtask run canceled by context", llog.ShortError(err)) + } else { + e.sampleLogger.Error("run subtask failed", zap.Error(err)) + } } else { // if we run a subtask successfully, we will try to run next subtask // immediately for once.