mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-04 05:09:48 +08:00
[Fix-7538] [server] Fix when there is a forbidden node in dag, the execution flow is abnormal (#7613)
* when there is a forbidden node in dag, the execution flow is abnormal Co-authored-by: hongjie.li <hongjie.li@dmall.com>
This commit is contained in:
parent
605767e47b
commit
3af4d765c2
@ -1083,13 +1083,10 @@ public class WorkflowExecuteThread {
|
||||
return DependResult.SUCCESS;
|
||||
}
|
||||
TaskNode taskNode = dag.getNode(taskCode);
|
||||
List<String> depCodeList = taskNode.getDepList();
|
||||
for (String depsNode : depCodeList) {
|
||||
if (!dag.containsNode(depsNode)
|
||||
|| forbiddenTaskMap.containsKey(depsNode)
|
||||
|| skipTaskNodeMap.containsKey(depsNode)) {
|
||||
continue;
|
||||
}
|
||||
List<String> indirectDepCodeList = new ArrayList<>();
|
||||
setIndirectDepList(taskCode, indirectDepCodeList);
|
||||
for (String depsNode : indirectDepCodeList) {
|
||||
if (dag.containsNode(depsNode) && !skipTaskNodeMap.containsKey(depsNode)) {
|
||||
// dependencies must be fully completed
|
||||
if (!completeTaskMap.containsKey(depsNode)) {
|
||||
return DependResult.WAITING;
|
||||
@ -1107,10 +1104,30 @@ public class WorkflowExecuteThread {
|
||||
return DependResult.FAILED;
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.info("taskCode: {} completeDependTaskList: {}", taskCode, Arrays.toString(completeTaskMap.keySet().toArray()));
|
||||
return DependResult.SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is specially used to handle the dependency situation where the parent node is a prohibited node.
|
||||
* When the parent node is a forbidden node, the dependency relationship should continue to be traced
|
||||
*
|
||||
* @param taskCode taskCode
|
||||
* @param indirectDepCodeList All indirectly dependent nodes
|
||||
*/
|
||||
private void setIndirectDepList(String taskCode, List<String> indirectDepCodeList) {
|
||||
TaskNode taskNode = dag.getNode(taskCode);
|
||||
List<String> depCodeList = taskNode.getDepList();
|
||||
for (String depsNode : depCodeList) {
|
||||
if (forbiddenTaskMap.containsKey(depsNode)) {
|
||||
setIndirectDepList(depsNode, indirectDepCodeList);
|
||||
} else {
|
||||
indirectDepCodeList.add(depsNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* depend node is completed, but here need check the condition task branch is the next node
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user