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 2021/04/28 15:58:05 UTC

[GitHub] [pulsar] rdhabalia commented on a change in pull request #10417: [pulsar-broker] Dispatch messaages to consumer with permits

rdhabalia commented on a change in pull request #10417:
URL: https://github.com/apache/pulsar/pull/10417#discussion_r622320825



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
##########
@@ -480,7 +481,9 @@ protected void sendMessagesToConsumers(ReadType readType, List<Entry> entries) {
         long totalMessagesSent = 0;
         long totalBytesSent = 0;
 
-        while (entriesToDispatch > 0 && totalAvailablePermits > 0 && isAtleastOneConsumerAvailable()) {
+        int firstAvailableConsumerPermits = getFirstAvailableConsumerPermits();
+        int currentTotalAvailablePermits = Math.max(totalAvailablePermits, firstAvailableConsumerPermits);
+        while (entriesToDispatch > 0 && currentTotalAvailablePermits > 0 && firstAvailableConsumerPermits > 0) {

Review comment:
       thanks for catching it. yes, I missed to push the commit. fixed now. 




-- 
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:
users@infra.apache.org