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 2021/11/13 11:53:40 UTC

[GitHub] [pulsar] Jason918 commented on a change in pull request #12779: [Java Client] Use epoch to version producer's cnx to prevent early de…

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



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionHandler.java
##########
@@ -37,7 +37,8 @@
     protected final Backoff backoff;
     private static final AtomicLongFieldUpdater<ConnectionHandler> EPOCH_UPDATER = AtomicLongFieldUpdater
             .newUpdater(ConnectionHandler.class, "epoch");
-    private volatile long epoch = 0L;
+    // Start with -1L because it gets incremented before sending on the first connection
+    private volatile long epoch = -1L;

Review comment:
       Does the starting value of epoch mean anything? In my understanding, it's just used for comparison, right?




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