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



##########
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:
       I don't believe the starting value inherently means anything. However, 
the test `ProducerCreationTest#testGeneratedNameProducerReconnect` asserts that 
the `epoch` value is 2 after a single producer reconnect. I could have updated 
the test or the starting value. I chose to update the starting value here to 
maintain the original behavior.




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