poorbarcode commented on code in PR #20407:
URL: https://github.com/apache/pulsar/pull/20407#discussion_r1207415080
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##########
@@ -191,6 +191,10 @@ public synchronized CompletableFuture<Void>
addConsumer(Consumer consumer) {
return CompletableFuture.completedFuture(null);
}
+ protected synchronized void rewindCursor() {
Review Comment:
@lhotari
> just wondering if it's necessary to make this method synchronized
You're right, all the locations that called this method have already
acquired the lock. The purpose of declaring `synchronized` here is to make the
code more readable, and there is no more performance overhead.
The point of locking is to prevent `add consumer` and `remove consumer` and
`clear recentJoinedConsumers` execute concurrence.
--
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]