@@ -68,27 +68,28 @@ func (d *dagContext) GetTaskNode(taskName string) *wfv1.NodeStatus {
68
68
}
69
69
70
70
// Assert all branch finished for failFast:disable function
71
- func (d * dagContext ) assertBranchFinished (targetTaskName string ) bool {
71
+ func (d * dagContext ) assertBranchFinished (targetTaskNames [] string ) bool {
72
72
// We should ensure that from the bottom to the top,
73
73
// all the nodes of this branch have at least one failure.
74
74
// If successful, we should continue to run down until the leaf node
75
- taskNode := d .GetTaskNode (targetTaskName )
76
- if taskNode == nil {
77
- taskObject := d .getTask (targetTaskName )
78
- if taskObject != nil {
79
- // Make sure all the dependency node have one failed
80
- for _ , tmpTaskName := range taskObject .Dependencies {
75
+ flag := false
76
+ for _ , targetTaskName := range targetTaskNames {
77
+ taskNode := d .GetTaskNode (targetTaskName )
78
+ if taskNode == nil {
79
+ taskObject := d .getTask (targetTaskName )
80
+ if taskObject != nil {
81
+ // Make sure all the dependency node have one failed
81
82
// Recursive check until top root node
82
- return d .assertBranchFinished (tmpTaskName )
83
+ return d .assertBranchFinished (taskObject . Dependencies )
83
84
}
85
+ } else if ! taskNode .Successful () {
86
+ flag = true
84
87
}
85
- } else if ! taskNode .Successful () {
86
- return true
87
- }
88
88
89
- // In failFast situation, if node is successful, it will run to leaf node, above
90
- // the function, we have already check the leaf node status
91
- return false
89
+ // In failFast situation, if node is successful, it will run to leaf node, above
90
+ // the function, we have already check the leaf node status
91
+ }
92
+ return flag
92
93
}
93
94
94
95
// assessDAGPhase assesses the overall DAG status
@@ -128,7 +129,7 @@ func (d *dagContext) assessDAGPhase(targetTasks []string, nodes map[string]wfv1.
128
129
tmpDepNode := d .GetTaskNode (tmpDepName )
129
130
if tmpDepNode == nil {
130
131
// If leaf node is nil, we should check it's parent node and recursive check
131
- if ! d .assertBranchFinished (tmpDepName ) {
132
+ if ! d .assertBranchFinished ([] string { tmpDepName } ) {
132
133
tmpOverAllFinished = false
133
134
}
134
135
} else if tmpDepNode .Type == wfv1 .NodeTypeRetry && d .hasMoreRetries (tmpDepNode ) {
0 commit comments