-
RMContainer is creating opportunistic container, and it will read ContainerId(line#3 below code)
-
public static RMContainer createOpportunisticRmContainer(RMContext rmContext, Container container, boolean isRemotelyAllocated) { appAttempt.addRMContainer(container.getId(), rmContainer); node.allocateContainer(rmContainer); return rmContainer; } ..... handleNewContainers{ rmContainer.handle( new RMContainerEvent(container.getId(), RMContainerEventType.ACQUIRED)); }
-
Shutdown command is sent to NM who holds the container, so KILL event will come.
-
the state of RMContainer changes to KILLED
-
Then RM will send ACQUIR event to RMContainer(code#9), but it can't handle this event at KILLED state.
- Inject shutdown command is very important to trigger KILL Event.
pre-read
org.apache.hadoop.yarn.server.resourcemanager.OpportunisticContainerAllocatorAMService$OpportunisticAMSProcessor allocate 182