eolivelli commented on a change in pull request #13069:
URL: https://github.com/apache/pulsar/pull/13069#discussion_r761452305



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
##########
@@ -622,24 +640,33 @@ private void searchForCandidateBroker(NamespaceBundle 
bundle,
     }
 
     private boolean isBrokerActive(String candidateBroker) {
-        List<String> brokers = 
pulsar.getLocalMetadataStore().getChildren(LoadManager.LOADBALANCE_BROKERS_ROOT).join();
-
-        for (String brokerHostPort : brokers) {
-            if (candidateBroker.equals("http://"; + brokerHostPort)) {
+        URI uri = URI.create(candidateBroker);

Review comment:
       URI os generally expensive. Do we need this or it is worth to do it 
another way?

##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
##########
@@ -454,6 +454,7 @@ private void searchForCandidateBroker(NamespaceBundle 
bundle,
             // The leader election service was not initialized yet. This can 
happen because the broker service is
             // initialized first and it might start receiving lookup requests 
before the leader election service is
             // fully initialized.
+            LOG.warn("Leader election service isn't initialized yet. Returning 
empty result to lookup.");

Review comment:
       Do we have some meaningful context for whom reads the logs?




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