From ece9e77edb741925a2fa08a2d1859d91f6c0e921 Mon Sep 17 00:00:00 2001 From: Wenjun Ruan Date: Thu, 2 Feb 2023 11:10:37 +0800 Subject: [PATCH] Fix serial wait will go into block when there is no task need to submit (#13486) --- .../service/process/ProcessServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java index 8e63b3128f..73378a9163 100644 --- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java +++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java @@ -302,7 +302,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); deleteCommandWithCheck(command.getId()); return null; @@ -328,7 +328,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); } @@ -344,7 +344,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()) { @@ -372,7 +372,7 @@ public class ProcessServiceImpl implements ProcessService { } } } - processInstance.setStateWithDesc(WorkflowExecutionStatus.SUBMITTED_SUCCESS, + processInstance.setStateWithDesc(WorkflowExecutionStatus.RUNNING_EXECUTION, "submit by serial_priority strategy"); processInstanceDao.upsertProcessInstance(processInstance); }