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/08/05 15:23:17 UTC

[GitHub] [pulsar] Vanlightly commented on a change in pull request #11570: [Issue 11496][C++] Allow partitioned producers to start lazily

Vanlightly commented on a change in pull request #11570:
URL: https://github.com/apache/pulsar/pull/11570#discussion_r683557403



##########
File path: pulsar-client-cpp/lib/PartitionedProducerImpl.cc
##########
@@ -161,7 +182,13 @@ void PartitionedProducerImpl::sendAsync(const Message& msg, SendCallback callbac
     }
     // find a producer for that partition, index should start from 0
     ProducerImplPtr producer = producers_[partition];
+
+    if (conf_.getLazyStartPartitionedProducers() && !producer->isStarted()) {
+        producer->start();

Review comment:
       It isn't but this code is protected by the producersLock so it can't be called twice concurrently.




-- 
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