[ 
https://issues.apache.org/jira/browse/YARN-3160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14314700#comment-14314700
 ] 

Wangda Tan commented on YARN-3160:
----------------------------------

Maybe we could rename the {{nodeUpdateQueue}} to {{nodeUpdatedContainersQueue}} 
or just {{nodeUpdatedContainers}} together with the patch? The 
{{nodeUpdateQueue}} seems isn't very clear to me. 

Thoughts?

> Non-atomic operation on nodeUpdateQueue in RMNodeImpl
> -----------------------------------------------------
>
>                 Key: YARN-3160
>                 URL: https://issues.apache.org/jira/browse/YARN-3160
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: resourcemanager
>    Affects Versions: 2.7.0
>            Reporter: Chengbing Liu
>            Assignee: Chengbing Liu
>         Attachments: YARN-3160.2.patch, YARN-3160.patch
>
>
> {code:title=RMNodeImpl.java|borderStyle=solid}
> while(nodeUpdateQueue.peek() != null){
>   latestContainerInfoList.add(nodeUpdateQueue.poll());
> }
> {code}
> The above code brings potential risk of adding null value to 
> {{latestContainerInfoList}}. Since {{ConcurrentLinkedQueue}} implements a 
> wait-free algorithm, we can directly poll the queue, before checking whether 
> the value is null.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to