From a1b6b033ad53d311329aa095446656491565ca21 Mon Sep 17 00:00:00 2001 From: WangJPLeo <103574007+WangJPLeo@users.noreply.github.com> Date: Fri, 6 May 2022 15:01:21 +0800 Subject: [PATCH] [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 --- .../server/master/runner/WorkflowExecuteThread.java | 5 +++++ .../server/master/WorkflowExecuteThreadTest.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java index b7af67e675..e4f09e5a9c 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java +++ b/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; } diff --git a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/WorkflowExecuteThreadTest.java b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/WorkflowExecuteThreadTest.java index 270dc318a7..6e1c84382d 100644 --- a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/WorkflowExecuteThreadTest.java +++ b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/WorkflowExecuteThreadTest.java @@ -164,7 +164,7 @@ public class WorkflowExecuteThreadTest { List taskInstances = (List) 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 taskInstanceEmpty = (List) method.invoke(workflowExecuteThread, JSONUtils.toJsonString(cmdParam)); Assert.assertTrue(taskInstanceEmpty.isEmpty());