Skip to content

Commit 10ec31d

Browse files
committed
YARN-9765. SLS runner crashes when run with metrics turned off. Contributed by Abhishek Modi.
1 parent 8aaf5e1 commit 10ec31d

File tree

1 file changed

+5
-1
lines changed
  • hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls

1 file changed

+5
-1
lines changed

hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
import org.apache.hadoop.yarn.sls.nodemanager.NMSimulator;
8686
import org.apache.hadoop.yarn.sls.resourcemanager.MockAMLauncher;
8787
import org.apache.hadoop.yarn.sls.scheduler.SLSCapacityScheduler;
88+
import org.apache.hadoop.yarn.sls.scheduler.SchedulerMetrics;
8889
import org.apache.hadoop.yarn.sls.scheduler.TaskRunner;
8990
import org.apache.hadoop.yarn.sls.scheduler.SLSFairScheduler;
9091
import org.apache.hadoop.yarn.sls.scheduler.ContainerSimulator;
@@ -779,7 +780,10 @@ private void increaseQueueAppNum(String queue) throws YarnException {
779780
}
780781

781782
queueAppNumMap.put(queueName, appNum);
782-
wrapper.getSchedulerMetrics().trackQueue(queueName);
783+
SchedulerMetrics metrics = wrapper.getSchedulerMetrics();
784+
if (metrics != null) {
785+
metrics.trackQueue(queueName);
786+
}
783787
}
784788

785789
private void runNewAM(String jobType, String user,

0 commit comments

Comments
 (0)