BewareMyPower commented on code in PR #17439:
URL: https://github.com/apache/pulsar/pull/17439#discussion_r971723869
##########
pulsar-client-cpp/lib/ProducerImpl.cc:
##########
@@ -204,7 +206,8 @@ void ProducerImpl::handleCreateProducer(const
ClientConnectionPtr& cnx, Result r
}
// if the producer is lazy the send timeout timer is already running
- if (!conf_.getLazyStartPartitionedProducers()) {
+ if (!(conf_.getLazyStartPartitionedProducers() &&
+ conf_.getAccessMode() == ProducerConfiguration::Shared)) {
Review Comment:
I got it. I think it's because the previous implementation of lazy producer
is somehow incorrect.
In Java client, when a `ProducerImpl` is created, it starts a send timer and
call `grabCnx()`. So for a `PartitionedProducerImpl` object, Java client
doesn't create a `ProducerImpl` if lazy start is enabled and the access mode is
`Shared`.
However, in C++ client, the send timer is started after `grabCnx()` is
called, which are both called in `ProducerImpl::start`, while the creation of a
`ProducerImpl` doesn't do anything.
Regarding this PR, I think you can just keep the existing logic.
--
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]