codelipenghui commented on code in PR #21096:
URL: https://github.com/apache/pulsar/pull/21096#discussion_r1313043260


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java:
##########
@@ -179,25 +187,23 @@ private static Pair<Set<String>, Set<String>> 
getIsolationGroup(
         return pair;
     }
 
-    private Set<BookieId> getExcludedBookiesWithIsolationGroups(int 
ensembleSize,
+    @VisibleForTesting
+    Set<BookieId> getExcludedBookiesWithIsolationGroups(int ensembleSize,
         Pair<Set<String>, Set<String>> isolationGroups) {
         Set<BookieId> excludedBookies = new HashSet<>();
-        if (isolationGroups != null && 
isolationGroups.getLeft().contains(PULSAR_SYSTEM_TOPIC_ISOLATION_GROUP))  {
+        if (isolationGroups != null && 
isolationGroups.getLeft().contains(PULSAR_SYSTEM_TOPIC_ISOLATION_GROUP)) {
             return excludedBookies;
         }
         try {
             if (bookieMappingCache != null) {
-                CompletableFuture<Optional<BookiesRackConfiguration>> future =
-                        
bookieMappingCache.get(BookieRackAffinityMapping.BOOKIE_INFO_ROOT_PATH);
-
-                Optional<BookiesRackConfiguration> optRes = (future.isDone() 
&& !future.isCompletedExceptionally())
-                        ? future.join() : Optional.empty();
+                Optional<BookiesRackConfiguration> optional =
+                        
bookieMappingCache.get(BookieRackAffinityMapping.BOOKIE_INFO_ROOT_PATH).get(
+                                metaOpTimeout, TimeUnit.MILLISECONDS);

Review Comment:
   Can the zookeeper thread reach here? Just to confirm it will not introduce a 
deadlock.



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