michaeljmarshall commented on a change in pull request #14970:
URL: https://github.com/apache/pulsar/pull/14970#discussion_r839835383
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
##########
@@ -163,12 +163,17 @@ protected boolean isConsumersExceededOnSubscription() {
return isConsumersExceededOnSubscription(topic, consumerList.size());
}
+ private void removeAllConsumer(Consumer consumer){
+ while(consumerList.remove(consumer)){
+ }
+ }
+
@Override
public synchronized void removeConsumer(Consumer consumer) throws
BrokerServiceException {
// decrement unack-message count for removed consumer
addUnAckedMessages(-consumer.getUnackedMessages());
if (consumerSet.removeAll(consumer) == 1) {
- consumerList.remove(consumer);
+ removeAllConsumer(consumer);
Review comment:
I agree with this sentiment. I wonder about the data structure itself,
too. Why is it a list and not a set?
--
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]