YARN-9033. ResourceHandlerChain#bootstrap is invoked twice during NM start if LinuxContainerExecutor enabled. Contributed by Zhankun Tang.
This commit is contained in:
parent
35f1014b3e
commit
7861a5eb1a
@ -35,7 +35,6 @@ import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Cont
|
|||||||
|
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerImpl;
|
import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerImpl;
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.ResourceHandlerChain;
|
import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.ResourceHandlerChain;
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.ResourceHandlerException;
|
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.ResourceHandlerModule;
|
import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.ResourceHandlerModule;
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor
|
import org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor
|
||||||
.ChangeMonitoringContainerResourceEvent;
|
.ChangeMonitoringContainerResourceEvent;
|
||||||
@ -44,7 +43,6 @@ import org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.Contai
|
|||||||
|
|
||||||
|
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.metrics.NodeManagerMetrics;
|
import org.apache.hadoop.yarn.server.nodemanager.metrics.NodeManagerMetrics;
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.recovery.NMStateStoreService;
|
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.recovery.NMStateStoreService
|
import org.apache.hadoop.yarn.server.nodemanager.recovery.NMStateStoreService
|
||||||
.RecoveredContainerState;
|
.RecoveredContainerState;
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.recovery.NMStateStoreService.RecoveredContainerStatus;
|
import org.apache.hadoop.yarn.server.nodemanager.recovery.NMStateStoreService.RecoveredContainerStatus;
|
||||||
@ -132,21 +130,14 @@ public class ContainerScheduler extends AbstractService implements
|
|||||||
@Override
|
@Override
|
||||||
public void serviceInit(Configuration conf) throws Exception {
|
public void serviceInit(Configuration conf) throws Exception {
|
||||||
super.serviceInit(conf);
|
super.serviceInit(conf);
|
||||||
try {
|
if (resourceHandlerChain == null) {
|
||||||
if (resourceHandlerChain == null) {
|
resourceHandlerChain = ResourceHandlerModule
|
||||||
resourceHandlerChain = ResourceHandlerModule
|
.getConfiguredResourceHandlerChain(conf, context);
|
||||||
.getConfiguredResourceHandlerChain(conf, context);
|
}
|
||||||
}
|
if (LOG.isDebugEnabled()) {
|
||||||
LOG.debug("Resource handler chain enabled = {}",
|
LOG.debug("Resource handler chain enabled = " + (resourceHandlerChain
|
||||||
(resourceHandlerChain != null));
|
!= null));
|
||||||
if (resourceHandlerChain != null) {
|
|
||||||
LOG.debug("Bootstrapping resource handler chain");
|
|
||||||
resourceHandlerChain.bootstrap(conf);
|
|
||||||
}
|
|
||||||
} catch (ResourceHandlerException e) {
|
|
||||||
LOG.error("Failed to bootstrap configured resource subsystems! ", e);
|
|
||||||
throw new IOException(
|
|
||||||
"Failed to bootstrap configured resource subsystems!");
|
|
||||||
}
|
}
|
||||||
this.usePauseEventForPreemption =
|
this.usePauseEventForPreemption =
|
||||||
conf.getBoolean(
|
conf.getBoolean(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user