liyakun created YARN-9556: ----------------------------- Summary: Most containers will go through the process of ending twice when they are finished Key: YARN-9556 URL: https://issues.apache.org/jira/browse/YARN-9556 Project: Hadoop YARN Issue Type: Improvement Components: resourcemanager Reporter: liyakun Assignee: liyakun
When AM reports a container is finished in heartbeat, the container id will be added to containersToBeRemovedFromNM of RMNodeImpl. Next, when NM's heartbeat arrives, it will first execute the setAndUpdateNodeHeartbeatResponse() method in RMNodeImpl. In this method, it will execute: ``` this.completedContainers.removeAll(this.containersToBeRemovedFromNM); ... this.containersToBeRemovedFromNM.clear(); ``` The container id is removed in completedContainers so far, but heartbeat request still carries the state of the container id. In the subsequent processing, the handleContainerStatus() method in the RMNodeImpl is entered. In this method, the container id that was just deleted will be added to the completedContainers and newlyCompletedContainers again. Next, the container id will enter the updateCompletedContainers() method in the AbstractYarnScheduler class. It will be added to the untrackedContainerIdList and then go through the process of finish again by RMNodeFinishedContainersPulledByAMEvent. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org