lhotari commented on code in PR #23904:
URL: https://github.com/apache/pulsar/pull/23904#discussion_r1936780673


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:
##########
@@ -439,12 +439,17 @@ 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) {
+                            if(blockedByHash != null){
+                                blockedByHash.setTrue();
+                            }
+                            // decrement the permits for the consumer
+                            permits.decrement();
+                            // allow the entry to be dispatched
+                            dispatchEntry = true;
+                        }

Review Comment:
   In order to sync your forks master branch with apache/pulsar's master, there 
are some instructions here: 
https://pulsar.apache.org/contribute/personal-ci/#stay-in-sync-with-upstream



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