Browse Source

[Fix-10762] [bug] Dependent tasks wait for the workflow to end (#10765)

* issue 8645 (#8811)

Co-authored-by: 北笙 <“zhanqian@cai-inc.com”>
Co-authored-by: zhanqian <zhanqian@cai-inc.com>

* [fix-8929][DAO]Description Failed to upload the file because the full name was too long (#9020)

* [fix-8929][DAO]Description Failed to upload the file because the full name was too long

* [DS-#8929][fix]Description Failed to upload the file because the full name was too long

* [DS-#8929][fix]Description Failed to upload the file because the full name was too long

* [DS-#8929][fix]Description Failed to upload the file because the full name was too long

Co-authored-by: houshuai <houshuai@jiguang.cn>

* [BUG][ALERT-SERVER]validate script before alert script (#9834)

* validate script before alert script

* fix validate script before alert script

* pick 8811/9020/9834

* fix ut

* fix pick error

* fix 10762

Co-authored-by: zhanqian <360400325@qq.com>
Co-authored-by: 北笙 <“zhanqian@cai-inc.com”>
Co-authored-by: zhanqian <zhanqian@cai-inc.com>
Co-authored-by: shuai hou <120306274@qq.com>
Co-authored-by: houshuai <houshuai@jiguang.cn>
Co-authored-by: Tq <tianqitobethefirst@gmail.com>
Co-authored-by: JinyLeeChina <jiny.li@foxmail.com>
2.0.7-release
JinYong Li 2 years ago committed by GitHub
parent
commit
42ba593ae4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
  2. 19
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/DependentExecute.java

1
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java

@ -64,6 +64,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.regex.Matcher;

19
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/DependentExecute.java

@ -115,16 +115,16 @@ public class DependentExecute {
dependentItem.getDefinitionCode(), dependentItem.getDepTaskCode());
return DependResult.WAITING;
}
if (!processInstance.getState().typeIsFinished()) {
logger.info("Wait for the dependent workflow to complete, processDefiniteCode:{}, taskCode:{}, processInstanceId:{}, processInstance state:{}",
dependentItem.getDefinitionCode(), dependentItem.getDepTaskCode(), processInstance.getId(), processInstance.getState());
return DependResult.WAITING;
}
// need to check workflow for updates, so get all task and check the task state
if (dependentItem.getDepTaskCode() == Constants.DEPENDENT_ALL_TASK_CODE) {
if (!processInstance.getState().typeIsFinished()) {
logger.info("Wait for the dependent workflow to complete, processDefiniteCode:{}, taskCode:{}, processInstanceId:{}, processInstance state:{}",
dependentItem.getDefinitionCode(), dependentItem.getDepTaskCode(), processInstance.getId(), processInstance.getState());
return DependResult.WAITING;
}
result = dependResultByProcessInstance(processInstance, dateInterval);
} else {
result = getDependTaskResult(dependentItem.getDepTaskCode(), dateInterval);
result = getDependTaskResult(processInstance, dependentItem.getDepTaskCode(), dateInterval);
}
if (result != DependResult.SUCCESS) {
break;
@ -192,10 +192,15 @@ public class DependentExecute {
/**
* get depend task result
*/
private DependResult getDependTaskResult(long taskCode, DateInterval dateInterval) {
private DependResult getDependTaskResult(ProcessInstance processInstance, long taskCode, DateInterval dateInterval) {
TaskInstance taskInstance = processService.findLastTaskInstanceInterval(taskCode, dateInterval);
DependResult result;
if (taskInstance == null) {
if (!processInstance.getState().typeIsFinished()) {
logger.info("Wait for the dependent workflow to complete, taskCode:{}, processInstanceId:{}, processInstance state:{}",
taskCode, processInstance.getId(), processInstance.getState());
return DependResult.WAITING;
}
TaskDefinition taskDefinition = processService.findTaskDefinitionByCode(taskCode);
if (taskDefinition == null) {
logger.error("Cannot find the task definition, something error, taskCode: {}", taskCode);

Loading…
Cancel
Save