From fa0bb5e546cfc09e59e096efe0d2ac33bed68a4d Mon Sep 17 00:00:00 2001 From: Zhou Zheng <1606079777@qq.comom> Date: Tue, 28 Jul 2020 12:58:51 +0800 Subject: [PATCH] [bugfix] issue #3324 --- .../master/runner/MasterExecThread.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java index 4b5c3f7d00..df1e139760 100644 --- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java +++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java @@ -670,6 +670,11 @@ public class MasterExecThread implements Runnable { } TaskNode taskNode = dag.getNode(taskName); + // condition node directly return success + if (taskNode.isConditionsTask()) { + return DependResult.SUCCESS; + } + List depNameList = taskNode.getDepList(); for(String depsNode : depNameList ){ if(!dag.containsNode(depsNode) @@ -682,10 +687,16 @@ public class MasterExecThread implements Runnable { return DependResult.WAITING; } ExecutionStatus depTaskState = completeTaskList.get(depsNode).getState(); - // conditions task would not return failed. - if(depTaskState.typeIsFailure() - && !DagHelper.haveConditionsAfterNode(depsNode, dag ) - && !dag.getNode(depsNode).isConditionsTask()){ + // conditions task should be handled separately + if (dag.getNode(depsNode).isConditionsTask()) { + List tmpTaskList = parseConditionTask(depsNode); + if (tmpTaskList.contains(taskName)){ + return DependResult.SUCCESS; + } + return DependResult.FAILED; + } + + if(depTaskState.typeIsFailure()){ return DependResult.FAILED; }