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



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
##########
@@ -447,7 +448,7 @@ public boolean registerNamespace(String namespace, boolean 
ensureOwned) throws P
     private void searchForCandidateBroker(NamespaceBundle bundle,
                                           
CompletableFuture<Optional<LookupResult>> lookupFuture,
                                           LookupOptions options) {
-        if (null == pulsar.getLeaderElectionService() || 
!pulsar.getLeaderElectionService().isElected()) {
+        if (null == pulsar.getLeaderElectionService()) {

Review comment:
       It's already that way. The `LeaderElectionService` is returning an 
`Optional<LeaderBroker>` and it will be empty in all the cases where there's 
not a current leader.




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