jai1 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_r126495141
##########
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:
handleCreateConsumer "connection_ = cnx" and disconnectConsumer
"connection_.reset()" can happen at the same time on different threads, hence
the lock
----------------------------------------------------------------
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