pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] lovelle 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:25:48 GMT
lovelle 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_r253965658
 
 

 ##########
 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:
   Great :+1: 

----------------------------------------------------------------
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