Browse Source

[Fix-4839][Server] Process cannot stop when killed with retry (#4841)

* [Fix-4839][Server] Process cannot stop when killed with retry

* [Fix-4839][Server] Process cannot stop when killed with retry
dddyszy 4 years ago
parent
commit
01b71f1a0d

+ 2 - 2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java

@@ -167,8 +167,8 @@ public class TaskInstanceServiceImpl extends BaseServiceImpl implements TaskInst
             return result;
         }
 
-        // check whether the task instance state type is failure
-        if (!task.getState().typeIsFailure()) {
+        // check whether the task instance state type is failure or cancel
+        if (!task.getState().typeIsFailure() && !task.getState().typeIsCancel()) {
             putMsg(result, Status.TASK_INSTANCE_STATE_OPERATION_ERROR, taskInstanceId, task.getState().toString());
             return result;
         }

+ 1 - 1
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ExecutionStatus.java

@@ -90,7 +90,7 @@ public enum ExecutionStatus {
      * @return status
      */
     public boolean typeIsFailure() {
-        return this == FAILURE || this == NEED_FAULT_TOLERANCE || this == KILL;
+        return this == FAILURE || this == NEED_FAULT_TOLERANCE;
     }
 
     /**