poorbarcode commented on code in PR #18315:
URL: https://github.com/apache/pulsar/pull/18315#discussion_r1017622216
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##########
@@ -94,7 +94,7 @@ public class PersistentDispatcherMultipleConsumers extends
AbstractDispatcherMul
protected volatile PositionImpl minReplayedPosition = null;
protected boolean shouldRewindBeforeReadingOrReplaying = false;
protected final String name;
- protected boolean sendInProgress;
+ private int sendingTaskCounter = 0;
Review Comment:
the variable `sendingTaskCounter` will be accessed by multiple threads,
suggestion `AtomicInterger`
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:
##########
@@ -322,15 +322,9 @@ protected synchronized boolean
trySendMessagesToConsumers(ReadType readType, Lis
}
// readMoreEntries should run regardless whether or not stuck is
caused by
// stuckConsumers for avoid stopping dispatch.
- sendInProgress = false;
-
topic.getBrokerService().executor().execute(safeRun(this::readMoreEntries));
+
topic.getBrokerService().executor().schedule(safeRun(this::readMoreEntries),
100, TimeUnit.MILLISECONDS);
Review Comment:
Why the 100ms delay?
--
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]