diff --git a/pulsar-client/src/main/java/com/yahoo/pulsar/client/impl/PulsarClientImpl.java b/pulsar-client/src/main/java/com/yahoo/pulsar/client/impl/PulsarClientImpl.java index 34f2c66085293..462f35ea7d047 100644 --- a/pulsar-client/src/main/java/com/yahoo/pulsar/client/impl/PulsarClientImpl.java +++ b/pulsar-client/src/main/java/com/yahoo/pulsar/client/impl/PulsarClientImpl.java @@ -418,7 +418,7 @@ void cleanupProducer(ProducerBase producer) { } void cleanupConsumer(ConsumerBase consumer) { - synchronized (consumer) { + synchronized (consumers) { consumers.remove(consumer); } }