baomingyu commented on a change in pull request #10096:
URL: https://github.com/apache/pulsar/pull/10096#discussion_r606034626
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java
##########
@@ -260,6 +266,8 @@ protected void sendMessagesToConsumers(ReadType readType,
List<Entry> entries) {
// readMoreEntries should run regardless whether or not stuck is
caused by
// stuckConsumers for avoid stopping dispatch.
readMoreEntries();
+ } else if (currentThreadKeyNumber == 0) {
Review comment:
yes, when last step messagesForC=0 in once loop while
groupedEntries.size() > 0,readMoreEntries will be trigger immediately, just in
this one scene. And if messagesForC=0 is not in the last step of one loop, it
will not be trigger immediately. And this change will not be stuck sending
message to consumer.
This way just trigger readMoreEntries method , and consumers receive more
message may be block by flow control or permits.
> If we have keyNumbers=10 first, then dispatch to consumers but
messagesForC=0 for each key, so the currentThreadKeyNumber will be 0 right?
here will trigger readMoreEntries immediately.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]