lhotari commented on a change in pull request #10180: URL: https://github.com/apache/pulsar/pull/10180#discussion_r621785353
########## File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java ########## @@ -184,7 +184,7 @@ public synchronized void removeConsumer(Consumer consumer) throws BrokerServiceE messagesToRedeliver.add(ledgerId, entryId); redeliveryTracker.addIfAbsent(PositionImpl.get(ledgerId, entryId)); }); - totalAvailablePermits -= consumer.getAvailablePermits(); + TOTAL_AVAILABLE_PERMITS_UPDATER.addAndGet(this, -consumer.getAvailablePermits()); Review comment: @merlimat I re-opened this PR. `readMoreEntries` method isn't synchronized and it's getting called from this location without synchronization: https://github.com/apache/pulsar/blob/a1cebdb3e7cc3b8ee3ce567058182e7d31c762d2/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L2439-L2451 . -- 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: us...@infra.apache.org