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

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

commit 9bb526855db74517c400417d50cf4e62d37e4c84
Author: Wenjun Ruan <wen...@apache.org>
AuthorDate: Tue Feb 6 15:25:50 2024 +0800

    Set the workflow instance ready state to running in failover (#15572)
    
    (cherry picked from commit 1b32e28cc821daf940c264fecec23b2225446a67)
---
 .../dolphinscheduler/service/process/ProcessServiceImpl.java      | 8 ++++++++
 1 file changed, 8 insertions(+)

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 1f27857513..fc906491d1 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
@@ -793,6 +793,14 @@ public class ProcessServiceImpl implements ProcessService {
                 break;
             case RECOVER_TOLERANCE_FAULT_PROCESS:
                 // recover tolerance fault process
+                // If the workflow instance is in ready state, we will change 
to running, this can avoid the workflow
+                // instance
+                // status is not correct with taskInsatnce status
+                if (processInstance.getState() == 
WorkflowExecutionStatus.READY_PAUSE
+                        || processInstance.getState() == 
WorkflowExecutionStatus.READY_STOP) {
+                    // todo: If we handle the ready state in 
WorkflowExecuteRunnable then we can remove below code
+                    
processInstance.setState(WorkflowExecutionStatus.RUNNING_EXECUTION);
+                }
                 processInstance.setRecovery(Flag.YES);
                 processInstance.setRunTimes(runTime + 1);
                 runStatus = processInstance.getState();

Reply via email to