You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/12/13 06:15:43 UTC

[GitHub] [rocketmq] guyinyou commented on pull request #3509: [ISSUE #2516]: Fix the value of sendThreadPoolQueueHeadWaitTimeMills is 0 most of the time

guyinyou commented on pull request #3509:
URL: https://github.com/apache/rocketmq/pull/3509#issuecomment-992142648


   I think it's not a deadlock problem.
   
   when queue.remove(), will point the next node of the node to be deleted to itself.
   **java.util.concurrent.LinkedBlockingQueue#dequeue**
   ```
       private E dequeue() {
           // assert takeLock.isHeldByCurrentThread();
           // assert head.item == null;
           Node<E> h = head;
           Node<E> first = h.next;
           h.next = h; // help GC
           head = first;
           E x = first.item;
           first.item = null;
           return x;
       }
   ```
   
   when queue.stream(), will fall into an endless loop.
   **LinkedBlockingQueue$LBQSpliterator#tryAdvance()**
   ![image](https://user-images.githubusercontent.com/36399867/145761467-a085c8b9-6a9b-4cb3-9af8-e1127cf67012.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org