YARN-9765. SLS runner crashes when run with metrics turned off. Contributed by Abhishek Modi.

This commit is contained in:
bibinchundatt 2019-08-21 13:48:21 +05:30
parent 8aaf5e1a14
commit 10ec31d20e

View File

@ -85,6 +85,7 @@
import org.apache.hadoop.yarn.sls.nodemanager.NMSimulator; import org.apache.hadoop.yarn.sls.nodemanager.NMSimulator;
import org.apache.hadoop.yarn.sls.resourcemanager.MockAMLauncher; import org.apache.hadoop.yarn.sls.resourcemanager.MockAMLauncher;
import org.apache.hadoop.yarn.sls.scheduler.SLSCapacityScheduler; import org.apache.hadoop.yarn.sls.scheduler.SLSCapacityScheduler;
import org.apache.hadoop.yarn.sls.scheduler.SchedulerMetrics;
import org.apache.hadoop.yarn.sls.scheduler.TaskRunner; import org.apache.hadoop.yarn.sls.scheduler.TaskRunner;
import org.apache.hadoop.yarn.sls.scheduler.SLSFairScheduler; import org.apache.hadoop.yarn.sls.scheduler.SLSFairScheduler;
import org.apache.hadoop.yarn.sls.scheduler.ContainerSimulator; import org.apache.hadoop.yarn.sls.scheduler.ContainerSimulator;
@ -779,7 +780,10 @@ private void increaseQueueAppNum(String queue) throws YarnException {
} }
queueAppNumMap.put(queueName, appNum); queueAppNumMap.put(queueName, appNum);
wrapper.getSchedulerMetrics().trackQueue(queueName); SchedulerMetrics metrics = wrapper.getSchedulerMetrics();
if (metrics != null) {
metrics.trackQueue(queueName);
}
} }
private void runNewAM(String jobType, String user, private void runNewAM(String jobType, String user,