From ab046dae9dd36e1d52a9b58e7964da416dd5bf32 Mon Sep 17 00:00:00 2001 From: JinYong Li <42576980+JinyLeeChina@users.noreply.github.com> Date: Fri, 1 Jul 2022 13:58:05 +0800 Subject: [PATCH] [Bug] [Fix-10673] Workflow recovery bug with failed tasks (#10722) * fix 10517 * fix dep warn bug * fix recover bug Co-authored-by: JinyLeeChina --- .../master/runner/WorkflowExecuteThread.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java index 39e903bdc2..1a0866f6f2 100644 --- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java +++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java @@ -1125,6 +1125,22 @@ public class WorkflowExecuteThread implements Runnable { if (errorTaskList.size() > 0) { return true; } + } else { + if (processInstance.getCommandType() == CommandType.RECOVER_TOLERANCE_FAULT_PROCESS + || processInstance.getCommandType() == CommandType.RECOVER_SUSPENDED_PROCESS) { + List failedList = processService.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.FAILURE); + if (!failedList.isEmpty()) { + return true; + } + List toleranceList = processService.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.NEED_FAULT_TOLERANCE); + if (!toleranceList.isEmpty()) { + return true; + } + List killedList = processService.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.KILL); + if (!killedList.isEmpty()) { + return true; + } + } } return dependFailedTask.size() > 0; }