codelipenghui commented on a change in pull request #8101:
URL: https://github.com/apache/pulsar/pull/8101#discussion_r492621290



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
##########
@@ -400,6 +400,11 @@ 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()) {
+            LOG.warn("The leader election has not yet been completed! 
NamespaceBundle[{}]", bundle);
+            lookupFuture.completeExceptionally(new IllegalStateException("The 
leader election has not yet been completed!"));

Review comment:
       As discussed with @4onni, this will resultin a client lookup timeout, 
and the client will relookup later, so it's not a problem here.




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