You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "JooHyukKim (via GitHub)" <gi...@apache.org> on 2023/06/30 09:25:00 UTC

[GitHub] [pulsar] JooHyukKim commented on a diff in pull request #20695: [fix] [client] Messages lost when consumer reconnect

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. 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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org