lhotari commented on a change in pull request #13993:
URL: https://github.com/apache/pulsar/pull/13993#discussion_r794682764



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/Backoff.java
##########
@@ -22,29 +22,59 @@
 import java.time.Clock;
 import java.util.Random;
 import java.util.concurrent.TimeUnit;
-import lombok.Data;
+import lombok.Getter;
 
-// All variables are in TimeUnit millis by default
-@Data

Review comment:
       > Great point. Do you think that I also need to make the mutable fields 
`volatile` then, since `toString()` and `.equals` won't be synchronized?
   
   I think that it would be an overkill to use volatile in this case. In Java 
with 64 bit JVMs you cannot hit a "word tearing" issue where the observed field 
value would be corrupted. The worst that could happen in Java (on a 64 bit JVM) 
is a data race. 




-- 
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-unsubscr...@pulsar.apache.org

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


Reply via email to