JooHyukKim commented on code in PR #20695:
URL: https://github.com/apache/pulsar/pull/20695#discussion_r1247654889


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -761,6 +761,11 @@ public void negativeAcknowledge(Message<?> message) {
 
     @Override
     public CompletableFuture<Void> connectionOpened(final ClientCnx cnx) {
+        // If success skip this subscribe request. If reconnection is 
required, whoever changes the state is
+        // responsible for reconnection. And the variable "duringConnect" will 
prevent the concurrent execution.
+        if (getState() == State.Ready) {
+            return CompletableFuture.completedFuture(null);
+        }

Review Comment:
   By `duringConnect`, did you mean `duringSeek` in the current method at line 
785? I am assuming this because I couldn't find the word `duringConnect` within 
the method or the class itself. 
   
   If `duringConnect` is outside, maybe providing JavaDoc  with `{@link }` tag 
will help readers to follow.



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