From 64e57410639e2b55ebf85261c205365e1466a90a Mon Sep 17 00:00:00 2001 From: Aaron Wang Date: Sat, 24 Jun 2023 22:10:14 +0800 Subject: [PATCH] [Bug-14378][Master] Trigger task execution in workflow instance page cause workflow instance keep running status (#14389) --- .../master/runner/WorkflowExecuteRunnable.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 83d7fb1ca9..e60da71472 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 @@ -2208,14 +2208,14 @@ public class WorkflowExecuteRunnable implements Callable { // remove task instance from taskInstanceMap, completeTaskSet, validTaskMap, errorTaskMap // completeTaskSet remove dependency taskInstanceMap, so the sort can't change - completeTaskSet.removeIf(set -> { - Optional existTaskInstanceOptional = getTaskInstance(set); + completeTaskSet.removeIf(taskCode -> { + Optional existTaskInstanceOptional = getTaskInstance(taskCode); return existTaskInstanceOptional - .filter(taskInstance -> dag.containsNode(Integer.toString(taskInstance.getId()))).isPresent(); + .filter(taskInstance -> dag.containsNode(Long.toString(taskInstance.getTaskCode()))).isPresent(); }); - taskInstanceMap.entrySet().removeIf(map -> dag.containsNode(Long.toString(map.getValue().getTaskCode()))); - validTaskMap.entrySet().removeIf(map -> dag.containsNode(Long.toString(map.getKey()))); - errorTaskMap.entrySet().removeIf(map -> dag.containsNode(Long.toString(map.getKey()))); + taskInstanceMap.entrySet().removeIf(entry -> dag.containsNode(Long.toString(entry.getValue().getTaskCode()))); + validTaskMap.entrySet().removeIf(entry -> dag.containsNode(Long.toString(entry.getKey()))); + errorTaskMap.entrySet().removeIf(entry -> dag.containsNode(Long.toString(entry.getKey()))); } private void saveCacheTaskInstance(TaskInstance taskInstance) {