diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index d9006176f9..707300a17a 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -404,6 +404,9 @@ Release 2.8.0 - UNRELEASED YARN-4031. Add JvmPauseMonitor to ApplicationHistoryServer and WebAppProxyServer (djp via rkanter) + YARN-4057. If ContainersMonitor is not enabled, only print + related log info one time. (Jun Gong via zxu) + OPTIMIZATIONS YARN-3339. TestDockerContainerExecutor should pull a single image and not diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java index 89dc980c70..afb51ad28b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java @@ -73,6 +73,7 @@ public class ContainersMonitorImpl extends AbstractService implements private boolean pmemCheckEnabled; private boolean vmemCheckEnabled; + private boolean containersMonitorEnabled; private long maxVCoresAllottedForContainers; @@ -153,6 +154,9 @@ protected void serviceInit(Configuration conf) throws Exception { LOG.info("Physical memory check enabled: " + pmemCheckEnabled); LOG.info("Virtual memory check enabled: " + vmemCheckEnabled); + containersMonitorEnabled = isEnabled(); + LOG.info("ContainersMonitor enabled: " + containersMonitorEnabled); + nodeCpuPercentageForYARN = NodeManagerHardwareUtils.getNodeCpuPercentage(conf); @@ -205,7 +209,7 @@ private boolean isEnabled() { @Override protected void serviceStart() throws Exception { - if (this.isEnabled()) { + if (containersMonitorEnabled) { this.monitoringThread.start(); } super.serviceStart(); @@ -213,7 +217,7 @@ protected void serviceStart() throws Exception { @Override protected void serviceStop() throws Exception { - if (this.isEnabled()) { + if (containersMonitorEnabled) { this.monitoringThread.interrupt(); try { this.monitoringThread.join(); @@ -648,7 +652,7 @@ public void setContainersUtilization(ResourceUtilization utilization) { @Override public void handle(ContainersMonitorEvent monitoringEvent) { - if (!isEnabled()) { + if (!containersMonitorEnabled) { return; }