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


##########
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:
   @guan46 Thanks.
   For some reason, the "Pulsar CI" workflow didn't run for the pull request. I 
also noticed that your fork's master branch isn't completely in sync with 
apache/pulsar master. It's necessary to get a recent CI fix included when you 
run "Pulsar CI" workflow in your fork. However that's not the reason why the 
workflow didn't execute. 
   When you go to 
https://github.com/guan46/pulsar/actions/workflows/pulsar-ci.yaml , do you see 
whether the workflow is enabled or not?
   Click "Enable workflow" if that is visible.
   <img width="852" alt="image" 
src="https://github.com/user-attachments/assets/45a0299e-2abe-4601-ae58-e6816a12b090";
 />



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