You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/01 13:01:59 UTC
[GitHub] [pulsar] eolivelli commented on a diff in pull request #17401: [fix][broker] Fix issue where leader broker information isn't available after 10 minutes of idling
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org