lenboo commented on a change in pull request #7808:
URL: https://github.com/apache/dolphinscheduler/pull/7808#discussion_r779323637
##########
File path:
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
##########
@@ -1171,11 +1172,33 @@ private DependResult
getDependResultForTask(TaskInstance taskInstance) {
* @param taskInstance task instance
*/
private void addTaskToStandByList(TaskInstance taskInstance) {
- logger.info("add task to stand by list, task name: {} , task id:{}",
taskInstance.getName(), taskInstance.getId());
try {
- if (!readyToSubmitTaskQueue.contains(taskInstance)) {
- readyToSubmitTaskQueue.put(taskInstance);
+ // need to check if the tasks with same task code is active
+ boolean exist = false;
+ Map<Integer, TaskInstance> taskInstanceMap =
taskInstanceHashMap.column(taskInstance.getTaskCode());
+ if (taskInstanceMap != null && taskInstanceMap.size() > 0) {
+ for (Entry<Integer, TaskInstance> entry :
taskInstanceMap.entrySet()) {
+ Integer taskInstanceId = entry.getKey();
+ if (activeTaskProcessorMaps.containsKey(taskInstanceId)) {
+ TaskInstance latestTaskInstance =
processService.findTaskInstanceById(taskInstanceId);
+ if (latestTaskInstance != null &&
!latestTaskInstance.getState().typeIsFailure()) {
Review comment:
Is it necessary to query task instance from db?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]