guan46 commented on code in PR #23904:
URL: https://github.com/apache/pulsar/pull/23904#discussion_r1933252663
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:
##########
@@ -439,12 +439,15 @@ private Map<Consumer, List<Entry>>
filterAndGroupEntriesForDispatching(List<Entr
permitsForConsumer.computeIfAbsent(consumer,
k -> new
MutableInt(getAvailablePermits(k)));
// a consumer was found for the sticky key hash and the
entry can be dispatched
- if (permits.intValue() > 0
- && canDispatchEntry(consumer, entry, readType,
stickyKeyHash, blockedByHash)) {
- // decrement the permits for the consumer
- permits.decrement();
- // allow the entry to be dispatched
- dispatchEntry = true;
+ if (permits.intValue() > 0) {
+ boolean canDispatchEntry = canDispatchEntry(consumer,
entry, readType, stickyKeyHash);
+ if (!canDispatchEntry) {
+ blockedByHash.setTrue();
Review Comment:
please take a look again @lhotari
--
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]