You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "thirdparty-core (via GitHub)" <gi...@apache.org> on 2023/08/02 07:46:31 UTC
[GitHub] [dolphinscheduler] thirdparty-core opened a new issue, #14688: [Bug] [master] Sub task of sub_process can't submit to run
thirdparty-core opened a new issue, #14688:
URL: https://github.com/apache/dolphinscheduler/issues/14688
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
在`WorkflowExecuteRunnable#submitStandByTask`方法中,当从readyToSubmitTaskQueue队列peek出的taskInstance实例的dependResult是WAITING时,由于peek并不能从readyToSubmitTaskQueue中remove掉taskInstance,将不能继续peek readyToSubmitTaskQueue中其他taskInstance做判断。在处理sub_process的processInstance时,导致某些情况下,sub_process的子任务一直不运行,而sub_process状态一直处于running状态。
代码如下:
```java
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);
}
}
```
所以,这个地方用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?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #14688: [Bug] [master] Sub task of sub_process can't submit to run
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #14688:
URL: https://github.com/apache/dolphinscheduler/issues/14688#issuecomment-1661683400
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
In the `WorkflowExecuteRunnable#submitStandByTask` method, when the dependResult of the taskInstance instance peeked out from the readyToSubmitTaskQueue queue is WAITING, since peek cannot remove the taskInstance from the readyToSubmitTaskQueue, it will not be able to continue to peek readyToSubmitTaskQueue to make judgments on other taskInstances. When processing the processInstance of sub_process, in some cases, the subtasks of sub_process have not been running, and the state of sub_process has been in the running state.
code show as below:
```java
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 happen
Do not block the judgment of taskInstance in the readyToSubmitTaskQueue queue
### How to reproduce
no
### Anything else
_No response_
### Version
3.1.x
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [master] Sub task of sub_process can't submit to run [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on issue #14688:
URL: https://github.com/apache/dolphinscheduler/issues/14688#issuecomment-2230245365
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [master] Sub task of sub_process can't submit to run [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS closed issue #14688: [Bug] [master] Sub task of sub_process can't submit to run
URL: https://github.com/apache/dolphinscheduler/issues/14688
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] MyLoveZhou commented on issue #14688: [Bug] [master] Sub task of sub_process can't submit to run
Posted by "MyLoveZhou (via GitHub)" <gi...@apache.org>.
MyLoveZhou commented on issue #14688:
URL: https://github.com/apache/dolphinscheduler/issues/14688#issuecomment-1681445252
我认为其实是合理的,因为这样任务只会按顺序执行。如果你可以让剩下的任务实例也经过扫描是一种不严谨的行为,有可能导致后面的任务执行,但是这个任务未执行的情况。至于sub_process中的子工作流的问题应该是前置条件未满足吧。也有可能是我没有理解你的意思,希望可以给我提供更多的信息,当然有图最好啦
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [master] Sub task of sub_process can't submit to run [dolphinscheduler]
Posted by "sean1205 (via GitHub)" <gi...@apache.org>.
sean1205 commented on issue #14688:
URL: https://github.com/apache/dolphinscheduler/issues/14688#issuecomment-2026665595
可以检查一下你的流程图里面有没有在中间节点存在禁止执行的节点
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [master] Sub task of sub_process can't submit to run [dolphinscheduler]
Posted by "chenshuai1995 (via GitHub)" <gi...@apache.org>.
chenshuai1995 commented on issue #14688:
URL: https://github.com/apache/dolphinscheduler/issues/14688#issuecomment-1890795593
I have meet this problem, but not to slove it. Do you have a good idea?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [master] Sub task of sub_process can't submit to run [dolphinscheduler]
Posted by "sean1205 (via GitHub)" <gi...@apache.org>.
sean1205 commented on issue #14688:
URL: https://github.com/apache/dolphinscheduler/issues/14688#issuecomment-2026667857
可以检查一下你的流程图里面有没有在中间节点存在禁止执行的节点,我们这里就发现在比较复杂的子流程图中非叶子结点配置了禁止节点导致死循环。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org