This is an automated email from the ASF dual-hosted git repository.
caishunfeng pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new a1b6b033ad [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)
a1b6b033ad is described below
commit a1b6b033ad53d311329aa095446656491565ca21
Author: WangJPLeo <[email protected]>
AuthorDate: Fri May 6 15:01:21 2022 +0800
[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
---
.../dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | 5 +++++
.../dolphinscheduler/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<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());