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

zhengchenyu commented on YARN-10643:
------------------------------------

Just use Iterator() could solve this problem. You could see nextNode in 
LinkedBlockingQueue.Itr, it handle the special situation which node point 
itself. So I fixed in patch YARN-10643.001.patch.


        /**
         * Returns the next live successor of p, or null if no such.
         *
         * Unlike other traversal methods, iterators need to handle both:
         * - dequeued nodes (p.next == p)
         * - (possibly multiple) interior removed nodes (p.item == null)
         */
        private Node<E> nextNode(Node<E> p) {
            for (;;) {
                Node<E> s = p.next;
                if (s == p)
                    return head.next;
                if (s == null || s.item != null)
                    return s;
                p = s;
            }
        }

> Fix the race condition introduced by YARN-8995.
> -----------------------------------------------
>
>                 Key: YARN-10643
>                 URL: https://issues.apache.org/jira/browse/YARN-10643
>             Project: Hadoop YARN
>          Issue Type: Bug
>    Affects Versions: 3.3.0, 3.2.1
>            Reporter: Qi Zhu
>            Assignee: Qi Zhu
>            Priority: Critical
>         Attachments: YARN-10643.001.patch
>
>
> The race condition introduced by -YARN-8995.-
> The problem has been raised in YARN-10221
> also in YARN-10642.
> I think we should fix it in a hurry.
> I will help fix it.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to