lhotari commented on code in PR #23904:
URL: https://github.com/apache/pulsar/pull/23904#discussion_r1935743121
##########
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:
For effective contributions, it is necessary to run tests and use tests to
provide feedback. Did you check my previous advice about Personal CI? When you
know what tests fail, you can then locally run a single unit test in your IDE.
Have you already tried this?
--
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]