pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] merlimat commented on a change in pull request #3521: Use testDupConsumersOnSharedModeNotThrowsExcOnUnsubscribe to avoid interference with other tests running in parallel
Date Tue, 05 Feb 2019 17:11:22 GMT
merlimat commented on a change in pull request #3521: Use testDupConsumersOnSharedModeNotThrowsExcOnUnsubscribe
to avoid interference with other tests running in parallel
URL: https://github.com/apache/pulsar/pull/3521#discussion_r253959989
 
 

 ##########
 File path: pulsar-client-cpp/lib/ClientImpl.cc
 ##########
 @@ -342,10 +342,11 @@ void ClientImpl::subscribeAsync(const std::string& topic, const
std::string& con
             return;
         } else if (conf.getConsumerType() == ConsumerShared) {
             ConsumersList consumers(consumers_);
-            for (ConsumersList::iterator it = consumers.begin(); it != consumers.end(); ++it)
{
-                ConsumerImplBasePtr consumer = it->lock();
+            for (auto& weakPtr : consumers) {
+                ConsumerImplBasePtr consumer = weakPtr.lock();
                 if (consumer && consumer->getSubscriptionName() == consumerName
&& !consumer->isClosed()) {
                     lock.unlock();
+                    LOG_INFO("Reusing existing consumer instance for " << topic <<
" -- " << consumerName);
 
 Review comment:
   The reason I added the log is that when looking at the logs one can now see `Subscribing..
` but there's no corresponding `Subscribed... ` message. I think info level should be ok to
keep the consistency with the rest of log messages.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message