gaoran10 commented on code in PR #21682:
URL: https://github.com/apache/pulsar/pull/21682#discussion_r1426087005
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##########
@@ -665,15 +672,9 @@ protected synchronized boolean
trySendMessagesToConsumers(ReadType readType, Lis
long totalEntries = 0;
int avgBatchSizePerMsg = remainingMessages > 0 ?
Math.max(remainingMessages / entries.size(), 1) : 1;
- int firstAvailableConsumerPermits, currentTotalAvailablePermits;
- boolean dispatchMessage;
- while (entriesToDispatch > 0) {
- firstAvailableConsumerPermits = getFirstAvailableConsumerPermits();
- currentTotalAvailablePermits = Math.max(totalAvailablePermits,
firstAvailableConsumerPermits);
- dispatchMessage = currentTotalAvailablePermits > 0 &&
firstAvailableConsumerPermits > 0;
Review Comment:
This logic is a little wired, maybe the current total available permits
should be the minimum value between `totalAvailablePermits` and
`firstAvailableConsumerPermits`, WDYT?
--
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]