This is an automated email from the ASF dual-hosted git repository.

kerwin pushed a commit to branch 3.1.7-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/3.1.7-prepare by this push:
     new 3554e7557a [fix-#14169]The subprocess type node is always in the 
```ready pause ``` or ``` ready stop ``` state (#14170)
3554e7557a is described below

commit 3554e7557aa879ec9a04e66b78ed6a063b51b553
Author: fuchanghai <[email protected]>
AuthorDate: Mon May 22 10:50:49 2023 +0800

    [fix-#14169]The subprocess type node is always in the ```ready pause ``` or 
``` ready stop ``` state (#14170)
---
 .../server/master/runner/task/SubTaskProcessor.java                 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java
 
b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java
index fe1896ec85..8fe41da9e7 100644
--- 
a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java
+++ 
b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java
@@ -178,7 +178,8 @@ public class SubTaskProcessor extends BaseTaskProcessor {
     private boolean pauseSubWorkFlow() {
         ProcessInstance subProcessInstance =
                 processService.findSubProcessInstance(processInstance.getId(), 
taskInstance.getId());
-        if (subProcessInstance == null || 
taskInstance.getState().isFinished()) {
+        if (subProcessInstance == null || taskInstance.getState().isFinished()
+                || subProcessInstance.getState().isFinished()) {
             return false;
         }
         
subProcessInstance.setStateWithDesc(WorkflowExecutionStatus.READY_PAUSE, "ready 
pause sub workflow");
@@ -214,7 +215,8 @@ public class SubTaskProcessor extends BaseTaskProcessor {
     protected boolean killTask() {
         ProcessInstance subProcessInstance =
                 processService.findSubProcessInstance(processInstance.getId(), 
taskInstance.getId());
-        if (subProcessInstance == null || 
taskInstance.getState().isFinished()) {
+        if (subProcessInstance == null || taskInstance.getState().isFinished()
+                || subProcessInstance.getState().isFinished()) {
             return false;
         }
         
subProcessInstance.setStateWithDesc(WorkflowExecutionStatus.READY_STOP, "ready 
stop by kill task");

Reply via email to