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 2022/08/24 05:53:59 UTC

[GitHub] [pulsar] lhotari commented on a diff in pull request #17252: [fix][broker] Make timestamp fields thread safe by using volatile to prevent visibility issues

lhotari commented on code in PR #17252:
URL: https://github.com/apache/pulsar/pull/17252#discussion_r953376245


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:
##########
@@ -129,7 +129,7 @@ public class Consumer {
 
     private static final double avgPercent = 0.9;
     private boolean preciseDispatcherFlowControl;
-    private PositionImpl readPositionWhenJoining;
+    private volatile PositionImpl readPositionWhenJoining;

Review Comment:
   that's true. the design of PositionImpl is not optimal since it's not an immutable class. However, in this case, the instance that is used is an "effectively immutable" instance. 



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