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. > >   -- 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]
