From 7a18adae5261e37def2ca1ede0320043d18abfab Mon Sep 17 00:00:00 2001 From: wangxj3 <857234426@qq.com> Date: Wed, 7 Jul 2021 17:34:38 +0800 Subject: [PATCH] [FIX-#5721][master-server] Global params parameter missing (#5757) Co-authored-by: wangxj --- .../apache/dolphinscheduler/dao/entity/TaskInstance.java | 4 ++++ .../server/master/runner/MasterExecThread.java | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java index 3733c6d58a..aa8727225a 100644 --- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java +++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java @@ -627,4 +627,8 @@ public class TaskInstance implements Serializable { public void setTaskParams(String taskParams) { this.taskParams = taskParams; } + + public boolean isFirstRun() { + return endTime == null; + } } 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 c18ed78b01..1863087fca 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 @@ -520,9 +520,6 @@ public class MasterExecThread implements Runnable { taskInstance.setDelayTime(taskNode.getDelayTime()); } - //get pre task ,get all the task varPool to this task - Set preTask = dag.getPreviousNodes(taskInstance.getName()); - getPreVarPool(taskInstance, preTask); return taskInstance; } @@ -1154,6 +1151,12 @@ public class MasterExecThread implements Runnable { continue; } } + //init varPool only this task is the first time running + if (task.isFirstRun()) { + //get pre task ,get all the task varPool to this task + Set preTask = dag.getPreviousNodes(task.getName()); + getPreVarPool(task, preTask); + } DependResult dependResult = getDependResultForTask(task); if (DependResult.SUCCESS == dependResult) { if (retryTaskIntervalOverTime(task)) {