From 2b4c1e06b67977dfed87fec0a528a1f9b75308d1 Mon Sep 17 00:00:00 2001 From: Wenjun Ruan Date: Thu, 22 Feb 2024 15:57:08 +0800 Subject: [PATCH] Fix recover pause workflowInstance may generate failover taskInstance (#15611) --- .../server/master/runner/WorkflowExecuteRunnable.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java index fa658c04f1..eafba17f69 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java @@ -1285,9 +1285,10 @@ public class WorkflowExecuteRunnable implements IWorkflowExecuteRunnable { || state == TaskExecutionStatus.SUBMITTED_SUCCESS || state == TaskExecutionStatus.DELAY_EXECUTION) { // try to take over task instance - if (state != TaskExecutionStatus.SUBMITTED_SUCCESS - && state != TaskExecutionStatus.DELAY_EXECUTION - && tryToTakeOverTaskInstance(existTaskInstance)) { + if (state == TaskExecutionStatus.SUBMITTED_SUCCESS || state == TaskExecutionStatus.DELAY_EXECUTION + || state == TaskExecutionStatus.DISPATCH) { + // The taskInstance is not in running, directly takeover it + } else if (tryToTakeOverTaskInstance(existTaskInstance)) { log.info("Success take over task {}", existTaskInstance.getName()); continue; } else {