Jason918 commented on a change in pull request #14566:
URL: https://github.com/apache/pulsar/pull/14566#discussion_r829690543



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java
##########
@@ -1036,6 +1037,8 @@ private void doSubscribeTopicPartitions(Schema<T> schema,
                         synchronized (pauseMutex) {
                             if (paused) {

Review comment:
       > I think maybe we can remove the `synchronized (pauseMutex)` too
   
   Not really, if the pause state changes between after 1038 and before line 
1043, pause state of this newConsumer will be wrong.
   
   > If we create a new consumer with `pause` state, we don't need to pause it 
again.
   
   Yes, but current implementation of `newConsumer.pause()` and 
`newConsumer.resume()` is idempotent and handles the case when it's called 
repeatedly. I think the code is more clear this way. WDYT? @aloyszhang 




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to