diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java b/escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java index 44262488fa..54220f0ea9 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java @@ -923,7 +923,11 @@ public class ProcessDao extends AbstractBaseDao { taskInstance.setFlag(Flag.NO); updateTaskInstance(taskInstance); // crate new task instance - taskInstance.setRetryTimes(taskInstance.getRetryTimes() + 1 ); + if(taskInstance.getState() != ExecutionStatus.NEED_FAULT_TOLERANCE){ + taskInstance.setRetryTimes(taskInstance.getRetryTimes() + 1 ); + } + taskInstance.setEndTime(null); + taskInstance.setStartTime(new Date()); taskInstance.setFlag(Flag.YES); taskInstance.setHost(null); taskInstance.setId(0); diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/model/TaskInstance.java b/escheduler-dao/src/main/java/cn/escheduler/dao/model/TaskInstance.java index f37b1e4349..7f7981ef7c 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/model/TaskInstance.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/model/TaskInstance.java @@ -422,8 +422,12 @@ public class TaskInstance { if(this.isSubProcess()){ return false; } - return (this.getState().typeIsFailure() + if(this.getState() == ExecutionStatus.NEED_FAULT_TOLERANCE){ + return true; + }else { + return (this.getState().typeIsFailure() && this.getRetryTimes() < this.getMaxRetryTimes()); + } } public void setDependency(String dependency) {