rdhabalia commented on a change in pull request #577: CPP add receiveAsync API
URL: https://github.com/apache/incubator-pulsar/pull/577#discussion_r128065737
##########
File path: pulsar-client-cpp/lib/ConsumerImpl.cc
##########
@@ -271,19 +272,39 @@ void ConsumerImpl::messageReceived(const
ClientConnectionPtr& cnx, const proto::
unsigned int numOfMessageReceived = 1;
if (metadata.has_num_messages_in_batch()) {
- Lock lock(mutex_);
Review comment:
Do you see any use of this `mutex_` here?
in fact I think it can create a dead-lock.
eg: if `incomingMessages-queue` is empty then `receive()` will take the
mutex and wait on it until message is received. Now, when message is received
and if it tries to take `mutex_` then it will create a deadlock.
However, for batch msg we are using `pendingReceiveMutex_` into
`receiveIndividualMessagesFromBatch` to sync msg-queue and pending-receive
queue.
----------------------------------------------------------------
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