You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by gi...@git.apache.org on 2017/08/30 22:00:44 UTC

[GitHub] rdhabalia commented on a change in pull request #726: Handle NPE at load-manager when leader couldn't find available broker

rdhabalia commented on a change in pull request #726: Handle NPE at load-manager when leader couldn't find available broker
URL: https://github.com/apache/incubator-pulsar/pull/726#discussion_r136201190
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
 ##########
 @@ -335,7 +334,13 @@ private void searchForCandidateBroker(NamespaceBundle bundle,
 
             if (candidateBroker == null) {
                 if (!this.loadManager.get().isCentralized() || pulsar.getLeaderElectionService().isLeader()) {
-                    candidateBroker = getLeastLoadedFromLoadManager(bundle);
+                    Optional<String> availableBroker = getLeastLoadedFromLoadManager(bundle);
+                    if (!availableBroker.isPresent()) {
 
 Review comment:
   make sense.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services