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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:
##########
@@ -260,6 +267,12 @@ 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) {
+            topic.getBrokerService().executor().schedule(() -> {
+                synchronized 
(PersistentStickyKeyDispatcherMultipleConsumers.this) {
+                    readMoreEntries();
+                }
+            }, 100, TimeUnit.MILLISECONDS);

Review Comment:
   One detail is that before this PR there was a bug that if any connection was 
backpressured, readMoreEntries wouldn't be called and that would block all 
progress. 
   
   The consequence of this change seems to be that readMoreEntries is called 
twice when a Key_Shared subscription has at least 2 consumers. That doesn't 
seem to make sense to me. It seems that #16812 was added to prevent duplicate 
calls happening at the same time so I guess that is mitigated.



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