leizhiyuan commented on a change in pull request #14641:
URL: https://github.com/apache/pulsar/pull/14641#discussion_r824534746



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractDispatcherMultipleConsumers.java
##########
@@ -119,17 +119,13 @@ public Consumer getNextConsumer() {
             return null;
         }
 
-        if (currentConsumerRoundRobinIndex >= consumerList.size()) {
-            currentConsumerRoundRobinIndex = 0;
-        }
-
         int currentRoundRobinConsumerPriority = 
consumerList.get(currentConsumerRoundRobinIndex).getPriorityLevel();
 
         // first find available-consumer on higher level unless currentIndex 
is not on highest level which is 0
         if (currentRoundRobinConsumerPriority != 0) {
             int higherPriorityConsumerIndex = 
getConsumerFromHigherPriority(currentRoundRobinConsumerPriority);
             if (higherPriorityConsumerIndex != -1) {
-                currentConsumerRoundRobinIndex = higherPriorityConsumerIndex + 
1;
+                currentConsumerRoundRobinIndex = (higherPriorityConsumerIndex 
+ 1) % consumerList.size();

Review comment:
       next loop, It will check




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