ATat5 opened a new issue #4275:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/4275


   **Describe the bug**
   
   A task in process B depends on process A, and the dependent task supports 
failed retry
   
   When process A fails to execute, process B is executing the failed retry task
   
   At this time, if process B is ready to pause, the process status will be 
changed to failed
   
   While process B is ready to stop, the process status is changed to success
   
   **Expected behavior**
   
   I think that when process B is stopped, the process status should also be 
changed to failed.
   
   **Additional context**
   
   In the method runProcess(), the failed retry task will not be put into the 
completeTaskList. If the process is ready to stop, the failed retry task will 
be skipped, and update the process status to success. 
   
   However, if the process is ready to pause, the method 
hasRetryTaskInStandBy() is used to judge whether the failed retry task is 
included, and if it exists, it will be regarded as a failure.
   
   
   
   ```java
   private void runProcess() {
               ......
               // node fails, retry first, and then execute the failure process
               if (task.getState().typeIsFailure()) {
                   if (task.getState() == ExecutionStatus.NEED_FAULT_TOLERANCE) 
{
                       this.recoverToleranceFaultTaskList.add(task);
                   }
                   if (task.taskCanRetry()) {
                       addTaskToStandByList(task);
                   } else {
                       completeTaskList.put(task.getName(), task);
                       if (task.isConditionsTask()
                               || 
DagHelper.haveConditionsAfterNode(task.getName(), dag)) {
                           submitPostNode(task.getName());
                       } else {
                           errorTaskList.put(task.getName(), task);
                           if (processInstance.getFailureStrategy() == 
FailureStrategy.END) {
                               killTheOtherTasks();
                           }
                       }
                   }
                   continue;
               }
   ```
   
   ```java
   private void updateProcessInstanceState() {
           ExecutionStatus state = getProcessInstanceState();
           if (processInstance.getState() != state) {
   ```
   
   ```java
   private ExecutionStatus getProcessInstanceState() {
       ......
   
       // pause
       if (state == ExecutionStatus.READY_PAUSE) {
           return processReadyPause();
       }
   
       // stop
       if (state == ExecutionStatus.READY_STOP) {
           List<TaskInstance> stopList = 
getCompleteTaskByState(ExecutionStatus.STOP);
           List<TaskInstance> killList = 
getCompleteTaskByState(ExecutionStatus.KILL);
           if (CollectionUtils.isNotEmpty(stopList)
                   || CollectionUtils.isNotEmpty(killList)
                   || !isComplementEnd()) {
               return ExecutionStatus.STOP;
           } else {
               return ExecutionStatus.SUCCESS;
           }
       }
   ```
   
   ```java
   private ExecutionStatus processReadyPause() {
       if (hasRetryTaskInStandBy()) {
           return ExecutionStatus.FAILURE;
       }
   
       List<TaskInstance> pauseList = 
getCompleteTaskByState(ExecutionStatus.PAUSE);
       if (CollectionUtils.isNotEmpty(pauseList)
               || !isComplementEnd()
               || readyToSubmitTaskList.size() > 0) {
           return ExecutionStatus.PAUSE;
       } else {
           return ExecutionStatus.SUCCESS;
       }
   }
   ```
   
   
   
   **Which version of Dolphin Scheduler:**
   -[1.2.0]


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to