codersfarm commented on issue #5380:
URL: https://github.com/apache/rocketmq/issues/5380#issuecomment-1288281664

   Thanks. Main thead is blocked by countDownLatch until sub thead complete. 
The countDownLatch will goes zero, countDownLatch.await(timeoutMillis * 4, 
TimeUnit.MILLISECONDS) execute immediately. The query 
this.mQClientFactory.getMQClientAPIImpl().queryMessage(addr, requestHeader, 
timeoutMillis * 3 is timeoutMillis * 3,and the countDownLatch.await is 
timeoutMillis * 4.
   2022-10-24_090335
   2022-10-24_090408
   
   > Hi @codersfarm , IMO, I think the countDownLatch will goes zero whether 
the broker failed or not. And i think the purpose of this `await()` method is 
to wait for the for loop to complete so that the `queryResultList` results of 
querying all brokers can be retrieved. The `queryResultList` is incomplete 
without the `await()` method waiting for the completion of the for loop.
   > 
   > 
![image](https://user-images.githubusercontent.com/72536832/197370650-ab0054d9-0fa0-4f12-866b-8e422c8758d0.png)
 
![image](https://user-images.githubusercontent.com/72536832/197370613-da5dc0cd-b067-496b-b361-3db9743cd994.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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to