|
|
|
@ -98,7 +98,11 @@ public class MasterSchedulerThread implements Runnable {
|
|
|
|
|
InterProcessMutex mutex = null; |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
if(OSUtils.checkResource(masterConfig.getMasterMaxCpuloadAvg(), masterConfig.getMasterReservedMemory())){ |
|
|
|
|
boolean runCheckFlag = OSUtils.checkResource(masterConfig.getMasterMaxCpuloadAvg(), masterConfig.getMasterReservedMemory()); |
|
|
|
|
if(!runCheckFlag) { |
|
|
|
|
Thread.sleep(Constants.SLEEP_TIME_MILLIS); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (zkMasterClient.getZkClient().getState() == CuratorFrameworkState.STARTED) { |
|
|
|
|
|
|
|
|
|
// create distributed lock with the root node path of the lock space as /dolphinscheduler/lock/masters
|
|
|
|
@ -126,11 +130,6 @@ public class MasterSchedulerThread implements Runnable {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// accessing the command table every SLEEP_TIME_MILLIS milliseconds
|
|
|
|
|
Thread.sleep(Constants.SLEEP_TIME_MILLIS); |
|
|
|
|
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
logger.error("master scheduler thread exception : " + e.getMessage(),e); |
|
|
|
|
}finally{ |
|
|
|
|