merlimat commented on a change in pull request #555: CPP Client - Accessing 
connection_ pointer under a lock
URL: https://github.com/apache/incubator-pulsar/pull/555#discussion_r126260392
 
 

 ##########
 File path: pulsar-client-cpp/lib/ConsumerImpl.cc
 ##########
 @@ -581,7 +581,9 @@ void ConsumerImpl::doAcknowledge(const BatchMessageId& 
messageId, proto::Command
 
 void ConsumerImpl::disconnectConsumer() {
     LOG_DEBUG("Broker notification of Closed consumer: " << consumerId_);
+    Lock lock(mutex_);
 
 Review comment:
   Why is this locking needed? The weak pointer itself doesn't need it, and 
every time we access the weak pointer, we convert into a shared_ptr anyway to 
ensure it's still valid
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to