codelipenghui commented on a change in pull request #10096:
URL: https://github.com/apache/pulsar/pull/10096#discussion_r606202086
##########
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:
But the problem is this will waste CPU cycles, if for the next loop,
currentThreadKeyNumber still be 0, this will lead to trigger the next loop
immediately, my suggestion is delay for a while to trigger the next loop if
currentThreadKeyNumber==0 such as 100ms.
--
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]