-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] [master] Sub task of sub_process can't submit to run #14688
Comments
Search before asking
What happenedIn the int length = readyToSubmitTaskQueue. size();
for (int i = 0; i < length; i++) {
TaskInstance task = readyToSubmitTaskQueue. peek();
if (task == null) {
continue;
}
// stop tasks which is retrying if forced success happens
if (task. taskCanRetry()) {
TaskInstance retryTask = processService.findTaskInstanceById(task.getId());
if (retryTask != null && retryTask. getState(). equals(ExecutionStatus. FORCED_SUCCESS)) {
task.setState(retryTask.getState());
logger.info("task: {} has been forced success, put it into complete task list and stop retrying",
task. getName());
removeTaskFromStandbyList(task);
completeTaskMap.put(task.getTaskCode(), task.getId());
taskInstanceMap.put(task.getId(), task);
submitPostNode(Long. toString(task. getTaskCode()));
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<String> preTask = dag.getPreviousNodes(Long.toString(task.getTaskCode()));
getPreVarPool(task, preTask);
}
DependResult dependResult = getDependResultForTask(task);
if (DependResult. SUCCESS == dependResult) {
Optional<TaskInstance> taskInstanceOptional = submitTaskExec(task);
if (!taskInstanceOptional. isPresent()) {
this.taskFailedSubmit = true;
// Remove and add to complete map and error map
if (!removeTaskFromStandbyList(task)) {
logger. error(
"Task submit failed, remove from standby list failed, workflowInstanceId: {}, taskCode: {}",
processInstance. getId(),
task. getTaskCode());
}
completeTaskMap.put(task.getTaskCode(), task.getId());
taskInstanceMap.put(task.getId(), task);
errorTaskMap.put(task.getTaskCode(), task.getId());
activeTaskProcessorMaps. remove(task. getTaskCode());
logger.error("Task submitted failed, workflowInstanceId: {}, taskInstanceId: {}, taskCode: {}",
task.getProcessInstanceId(),
task. getId(),
task. getTaskCode());
} else {
removeTaskFromStandbyList(task);
}
} else if (DependResult. FAILED == dependResult) {
// if the dependency fails, the current node is not submitted and the state changes to failure.
dependFailedTaskMap.put(task.getTaskCode(), task.getId());
removeTaskFromStandbyList(task);
logger.info("Task dependent result is failed, taskInstanceId:{} depend result : {}",
task. getId(),
dependResult);
} else if (DependResult. NON_EXEC == dependResult) {
// for some reasons(depend task pause/stop) this task would not be submit
removeTaskFromStandbyList(task);
logger.info("Remove task due to depend result not executed, taskInstanceId:{} depend result : {}",
task. getId(),
dependResult);
}
} So, is it unreasonable to use the logic of the for loop in this place? What you expected to happenDo not block the judgment of taskInstance in the readyToSubmitTaskQueue queue How to reproduceno Anything elseNo response Version3.1.x Are you willing to submit PR?
Code of Conduct
|
我认为其实是合理的,因为这样任务只会按顺序执行。如果你可以让剩下的任务实例也经过扫描是一种不严谨的行为,有可能导致后面的任务执行,但是这个任务未执行的情况。至于sub_process中的子工作流的问题应该是前置条件未满足吧。也有可能是我没有理解你的意思,希望可以给我提供更多的信息,当然有图最好啦 |
I have meet this problem, but not to slove it. Do you have a good idea? |
可以检查一下你的流程图里面有没有在中间节点存在禁止执行的节点,我们这里就发现在比较复杂的子流程图中非叶子结点配置了禁止节点导致死循环。 |
Fixed. |
Search before asking
What happened
在
WorkflowExecuteRunnable#submitStandByTask
方法中,当从readyToSubmitTaskQueue队列peek出的taskInstance实例的dependResult是WAITING时,由于peek并不能从readyToSubmitTaskQueue中remove掉taskInstance,将不能继续peek readyToSubmitTaskQueue中其他taskInstance做判断。在处理sub_process的processInstance时,导致某些情况下,sub_process的子任务一直不运行,而sub_process状态一直处于running状态。代码如下:
所以,这个地方用for循环的逻辑是不是不合理?
What you expected to happen
不阻塞readyToSubmitTaskQueue队列中taskInstance的判断
How to reproduce
no
Anything else
No response
Version
3.1.x
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: