Przeglądaj źródła

[Fix-9906] After the serial wait execution strategy stops the running workflow instance, the instance will be woken up and executed if there is a wait instance. (#9907)

* After the serial wait execution strategy stops the running workflow instance, the instance will be woken up and executed if there is a wait instance.

* clear logic

* Resource overloading
WangJPLeo 3 lat temu
rodzic
commit
a1b6b033ad

+ 5 - 0
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java

@@ -668,6 +668,11 @@ public class WorkflowExecuteThread {
             logger.info("process:{} state {} change to {}", processInstance.getId(), processInstance.getState(), stateEvent.getExecutionStatus());
 
             if (stateEvent.getExecutionStatus() == ExecutionStatus.STOP) {
+                // serial wait execution type needs to wake up the waiting process
+                if (processDefinition.getExecutionType().typeIsSerialWait()){
+                    endProcess();
+                    return true;
+                }
                 this.updateProcessInstanceState(stateEvent);
                 return true;
             }

+ 1 - 1
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/WorkflowExecuteThreadTest.java

@@ -164,7 +164,7 @@ public class WorkflowExecuteThreadTest {
             List<TaskInstance> taskInstances = (List<TaskInstance>) method.invoke(workflowExecuteThread, JSONUtils.toJsonString(cmdParam));
             Assert.assertEquals(4, taskInstances.size());
 
-            cmdParam.put(CMD_PARAM_RECOVERY_START_NODE_STRING, "");
+            cmdParam.put(CMD_PARAM_RECOVERY_START_NODE_STRING, "1");
             List<TaskInstance> taskInstanceEmpty = (List<TaskInstance>) method.invoke(workflowExecuteThread, JSONUtils.toJsonString(cmdParam));
             Assert.assertTrue(taskInstanceEmpty.isEmpty());