Technoboy- opened a new issue #1522: MasterSchedulerThread bug
URL: https://github.com/apache/incubator-dolphinscheduler/issues/1522
 
 
   MasterSchedulerThread should not be sleep after handle command
   
   ```
   if(OSUtils.checkResource(masterConfig.getMasterMaxCpuloadAvg(), 
masterConfig.getMasterReservedMemory())){
                       if (zkMasterClient.getZkClient().getState() == 
CuratorFrameworkState.STARTED) {
   
                           // create distributed lock with the root node path 
of the lock space as /dolphinscheduler/lock/masters
                           String znodeLock = 
zkMasterClient.getMasterLockPath();
   
                           mutex = new 
InterProcessMutex(zkMasterClient.getZkClient(), znodeLock);
                           mutex.acquire();
   
                           ThreadPoolExecutor poolExecutor = 
(ThreadPoolExecutor) masterExecService;
                           int activeCount = poolExecutor.getActiveCount();
                           // make sure to scan and delete command  table in 
one transaction
                           Command command = processDao.findOneCommand();
                           if (command != null) {
                               logger.info(String.format("find one command: id: 
%d, type: %s", command.getId(),command.getCommandType().toString()));
   
                               try{
                                   processInstance = 
processDao.handleCommand(logger, OSUtils.getHost(), this.masterExecThreadNum - 
activeCount, command);
                                   if (processInstance != null) {
                                       logger.info("start master exec thread , 
split DAG ...");
                                       masterExecService.execute(new 
MasterExecThread(processInstance,processDao));
                                   }
                               }catch (Exception e){
                                   logger.error("scan command error ", e);
                                   processDao.moveToErrorCommand(command, 
e.toString());
                               }
                           }
                       }
                   }
   
                   // should not sleep here
                   Thread.sleep(Constants.SLEEP_TIME_MILLIS);
   ```

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to