From 75d1ad645c994feadf157fb2343141b3d9ec49bf Mon Sep 17 00:00:00 2001 From: bao liang <29528966+lenboo@users.noreply.github.com> Date: Fri, 23 Apr 2021 14:29:26 +0800 Subject: [PATCH] fix bug: 5349, work flow would running if task is killed by manual. (#5362) Co-authored-by: baoliang --- .../apache/dolphinscheduler/common/enums/DependResult.java | 3 ++- .../server/master/runner/MasterExecThread.java | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DependResult.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DependResult.java index 3e305f3920..f906c866aa 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DependResult.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DependResult.java @@ -26,6 +26,7 @@ public enum DependResult { * 0 success * 1 waiting * 2 failed + * 3 non execution */ - SUCCESS, WAITING, FAILED + SUCCESS, WAITING, FAILED, NON_EXEC } 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 d93e9e6813..19e10b400b 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 @@ -617,7 +617,7 @@ public class MasterExecThread implements Runnable { } ExecutionStatus depTaskState = completeTaskList.get(depsNode).getState(); if (depTaskState.typeIsPause() || depTaskState.typeIsCancel()) { - return DependResult.WAITING; + return DependResult.NON_EXEC; } // ignore task state if current task is condition if (taskNode.isConditionsTask()) { @@ -1148,6 +1148,10 @@ public class MasterExecThread implements Runnable { dependFailedTask.put(task.getName(), task); removeTaskFromStandbyList(task); logger.info("task {},id:{} depend result : {}", task.getName(), task.getId(), dependResult); + } else if (DependResult.NON_EXEC == dependResult) { + // for some reasons(depend task pause/stop) this task would not be submit + removeTaskFromStandbyList(task); + logger.info("remove task {},id:{} , because depend result : {}", task.getName(), task.getId(), dependResult); } } } catch (Exception e) {