eolivelli commented on a change in pull request #10696:
URL: https://github.com/apache/pulsar/pull/10696#discussion_r638723521
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
##########
@@ -248,7 +249,9 @@ public synchronized void readMoreEntries() {
// next entries as readCompletedEntries-callback was never
called
if ((messagesToReplayNow.size() - deletedMessages.size()) ==
0) {
havePendingReplayRead = false;
- readMoreEntries();
+ // We should not call readMoreEntries() recursively in the
same thread
+ // as there is a risk of StackOverflowError
+ topic.getBrokerService().executor().execute(() ->
readMoreEntries());
Review comment:
I have two high level questions about this change:
1) is it possible/does it make sense to not schedule the execution of
`readMoreEntries` if there is already another pending request of executing
`readModeEntries` ?
2) is this changing the semantics of how this method works ?
--
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]