Browse Source

Merge pull request #304 from qiaozhanwei/branch-1.0.2

only one master restart need failure and tolerant task restart scheduler
pull/2/head
乔占卫 6 years ago committed by GitHub
parent
commit
3ef73aea6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java
  2. 4
      escheduler-server/src/main/java/cn/escheduler/server/zk/ZKMasterClient.java

8
escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java

@ -1526,6 +1526,14 @@ public class ProcessDao extends AbstractBaseDao {
} }
public void selfFaultTolerant(int ... states){
List<ProcessInstance> processInstanceList = processInstanceMapper.listByStatus(states);
for (ProcessInstance processInstance:processInstanceList){
selfFaultTolerant(processInstance);
}
}
@Transactional(value = "TransactionManager",rollbackFor = Exception.class) @Transactional(value = "TransactionManager",rollbackFor = Exception.class)
public void selfFaultTolerant(ProcessInstance processInstance){ public void selfFaultTolerant(ProcessInstance processInstance){

4
escheduler-server/src/main/java/cn/escheduler/server/zk/ZKMasterClient.java

@ -123,9 +123,9 @@ public class ZKMasterClient extends AbstractZKClient {
// register master // register master
this.registMaster(); this.registMaster();
// check if fault tolerance is required // check if fault tolerance is required,failure and tolerance
if (getActiveMasterNum() == 1) { if (getActiveMasterNum() == 1) {
processDao.selfFaultTolerant(ExecutionStatus.RUNNING_EXEUTION.ordinal()); processDao.selfFaultTolerant(ExecutionStatus.RUNNING_EXEUTION.ordinal(),ExecutionStatus.NEED_FAULT_TOLERANCE.ordinal());
} }
} }

Loading…
Cancel
Save