merlimat commented on a change in pull request #10013:
URL: https://github.com/apache/pulsar/pull/10013#discussion_r599721880



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -1774,6 +1777,15 @@ public TopicStats getStats(boolean getPreciseBacklog, 
boolean subscriptionBacklo
 
         stats.ledgers = Lists.newArrayList();
         List<CompletableFuture<String>> futures = includeLedgerMetadata ? 
Lists.newArrayList() : null;
+        BookKeeperAdmin bookKeeperAdmin = 
brokerService.pulsar().getBookKeeperAdmin();
+        Collection<BookieId> allBookies;
+        try {
+            allBookies = bookKeeperAdmin.getAllBookies();

Review comment:
       This is mixing a blocking call into an async method. Instead we could be 
using the MetadataCache to have the list of bookies available.




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

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


Reply via email to