Fix serial wait will go into block when there is no task need to submit (#13486)

This commit is contained in:
Wenjun Ruan 2023-02-02 11:10:37 +08:00 committed by GitHub
parent 5fb6035f0d
commit 6300a9b8de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -336,7 +336,7 @@ public class ProcessServiceImpl implements ProcessService {
processInstance.getProcessDefinitionVersion());
if (processDefinition.getExecutionType().typeIsSerial()) {
saveSerialProcess(processInstance, processDefinition);
if (processInstance.getState() != WorkflowExecutionStatus.SUBMITTED_SUCCESS) {
if (processInstance.getState() != WorkflowExecutionStatus.RUNNING_EXECUTION) {
setSubProcessParam(processInstance);
triggerRelationService.saveProcessInstanceTrigger(command.getId(), processInstance.getId());
deleteCommandWithCheck(command.getId());
@ -364,7 +364,7 @@ public class ProcessServiceImpl implements ProcessService {
org.apache.dolphinscheduler.service.utils.Constants.RUNNING_PROCESS_STATE,
processInstance.getId());
if (CollectionUtils.isEmpty(runningProcessInstances)) {
processInstance.setStateWithDesc(WorkflowExecutionStatus.SUBMITTED_SUCCESS,
processInstance.setStateWithDesc(WorkflowExecutionStatus.RUNNING_EXECUTION,
"submit from serial_wait strategy");
processInstanceDao.upsertProcessInstance(processInstance);
}
@ -380,7 +380,7 @@ public class ProcessServiceImpl implements ProcessService {
processInstanceDao.upsertProcessInstance(processInstance);
return;
}
processInstance.setStateWithDesc(WorkflowExecutionStatus.SUBMITTED_SUCCESS,
processInstance.setStateWithDesc(WorkflowExecutionStatus.RUNNING_EXECUTION,
"submit from serial_discard strategy");
processInstanceDao.upsertProcessInstance(processInstance);
} else if (processDefinition.getExecutionType().typeIsSerialPriority()) {
@ -408,7 +408,7 @@ public class ProcessServiceImpl implements ProcessService {
}
}
}
processInstance.setStateWithDesc(WorkflowExecutionStatus.SUBMITTED_SUCCESS,
processInstance.setStateWithDesc(WorkflowExecutionStatus.RUNNING_EXECUTION,
"submit by serial_priority strategy");
processInstanceDao.upsertProcessInstance(processInstance);
}