You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/04/16 15:43:00 UTC

[GitHub] [pulsar] jiazhai commented on a change in pull request #6732: Auto update topic partitions for C++ client

jiazhai commented on a change in pull request #6732: Auto update topic partitions for C++ client
URL: https://github.com/apache/pulsar/pull/6732#discussion_r409658821
 
 

 ##########
 File path: pulsar-client-cpp/lib/PartitionedConsumerImpl.cc
 ##########
 @@ -162,14 +174,17 @@ void PartitionedConsumerImpl::handleUnsubscribeAsync(Result result, unsigned int
         callback(ResultUnknownError);
         return;
     }
-    assert(unsubscribedSoFar_ <= numPartitions_);
-    assert(consumerIndex <= numPartitions_);
+    Lock consumersLock(consumersMutex_);
+    const auto numPartitions = numPartitions_;
 
 Review comment:
   Could this change be avoid? Seems brings in lot of un-needed changes, also a little confusing to made `numPartitions_` and `numPartitions` mix-used together in this file.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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