You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/09/28 02:33:34 UTC

[GitHub] [pulsar] wuzhanpeng commented on a change in pull request #12202: Fix getting stuck when adding producers

wuzhanpeng commented on a change in pull request #12202:
URL: https://github.com/apache/pulsar/pull/12202#discussion_r717176613



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java
##########
@@ -404,7 +406,9 @@ public String getReplicatorPrefix() {
                 .thenCompose(__ ->
                         incrementTopicEpochIfNeeded(producer, producerQueuedFuture))
                 .thenCompose(producerEpoch -> {
-                    lock.writeLock().lock();
+                    Lock producerLock = producer.getAccessMode() == ProducerAccessMode.Shared
+                            ? lock.readLock() : lock.writeLock();
+                    producerLock.lock();

Review comment:
       Thanks for your reply! Let me take the liberty to ask, what does `counter` refer to in `internalAddProducer`?




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org