eolivelli commented on code in PR #17401:
URL: https://github.com/apache/pulsar/pull/17401#discussion_r960625291


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/coordination/impl/LeaderElectionImpl.java:
##########
@@ -102,10 +105,13 @@ private synchronized 
CompletableFuture<LeaderElectionState> elect() {
             } else {
                 return tryToBecomeLeader();
             }
-        }).thenCompose(leaderElectionState ->
-                // make sure that the cache contains the current leader
-                // so that getLeaderValueIfPresent works on all brokers
-                cache.get(path).thenApply(__ -> leaderElectionState));
+        }).thenComposeAsync(leaderElectionState -> {
+            // make sure that the cache contains the current leader
+            // so that getLeaderValueIfPresent works on all brokers
+            cache.refresh(path);

Review Comment:
   is this a blocking operation ?



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