Skip to content

Commit 045383f

Browse files
authored
[Fix-17030] Fix one task might be duplicate trigger if exist multiple predecessors (#17038)
1 parent 2721e87 commit 045383f

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/graph/IWorkflowExecutionGraph.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ public interface IWorkflowExecutionGraph {
115115

116116
/**
117117
* Check whether the given task can be trigger now.
118-
* <p> The task can be trigger if all the predecessors are finished and all predecessors are not failure/pause/kill.
118+
* <p> The task can be trigger only all the predecessors are finished and all predecessors are not failure/pause/kill.
119+
* <p> Once the task has been triggered, then will also return false.
119120
*/
120121
boolean isTriggerConditionMet(final ITaskExecutionRunnable taskExecutionRunnable);
121122

dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/graph/WorkflowExecutionGraph.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ public List<ITaskExecutionRunnable> getAllTaskExecutionRunnable() {
181181

182182
@Override
183183
public boolean isTriggerConditionMet(final ITaskExecutionRunnable taskExecutionRunnable) {
184+
if (isTaskExecutionRunnableActive(taskExecutionRunnable)
185+
|| isTaskExecutionRunnableInActive(taskExecutionRunnable)) {
186+
return false;
187+
}
184188
return getPredecessors(taskExecutionRunnable.getName())
185189
.stream()
186190
.allMatch(predecessor -> isTaskExecutionRunnableInActive(predecessor)

0 commit comments

Comments
 (0)