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/07/13 13:28:31 UTC

[GitHub] [pulsar] eolivelli commented on a diff in pull request #16573: [fix][broker]fix the zero value as denominator cause ArithmeticException when selectBroker use LeastResourceUsageWithWeight

eolivelli commented on code in PR #16573:
URL: https://github.com/apache/pulsar/pull/16573#discussion_r920078463


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LeastResourceUsageWithWeight.java:
##########
@@ -125,6 +125,11 @@ private double updateAndGetMaxResourceUsageWithWeight(String broker, BrokerData
     @Override
     public Optional<String> selectBroker(Set<String> candidates, BundleData bundleToAssign, LoadData loadData,
                                          ServiceConfiguration conf) {
+        if (candidates.isEmpty()) {
+            log.error("There are no available brokers as candidates at this point for bundle: {}", bundleToAssign);

Review Comment:
   I won't use "error", but "info". Error is scary



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