YARN-3160. Fix non-atomic operation on nodeUpdateQueue in RMNodeImpl. (Contributed by Chengbing Liu)

This commit is contained in:
Junping Du 2015-02-11 03:44:31 -08:00
parent a4ceea60f5
commit c541a374d8
2 changed files with 6 additions and 2 deletions

View File

@ -537,6 +537,9 @@ Release 2.7.0 - UNRELEASED
http(s)://proxy addr:port/proxy/<appId> to avoid duplicate sections. (Devaraj
K via zjshen)
YARN-3160. Fix non-atomic operation on nodeUpdateQueue in RMNodeImpl.
(Chengbing Liu via junping_du)
Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES

View File

@ -842,8 +842,9 @@ public class RMNodeImpl implements RMNode, EventHandler<RMNodeEvent> {
public List<UpdatedContainerInfo> pullContainerUpdates() {
List<UpdatedContainerInfo> latestContainerInfoList =
new ArrayList<UpdatedContainerInfo>();
while(nodeUpdateQueue.peek() != null){
latestContainerInfoList.add(nodeUpdateQueue.poll());
UpdatedContainerInfo containerInfo;
while ((containerInfo = nodeUpdateQueue.poll()) != null) {
latestContainerInfoList.add(containerInfo);
}
this.nextHeartBeat = true;
return latestContainerInfoList;