Samrat002 commented on code in PR #28190:
URL: https://github.com/apache/flink/pull/28190#discussion_r3259355453


##########
flink-filesystems/flink-s3-fs-native/src/main/java/org/apache/flink/fs/s3native/NativeS3FileSystemFactory.java:
##########
@@ -298,8 +300,8 @@ public class NativeS3FileSystemFactory implements 
FileSystemFactory {
                                     + "When not set, the default chain is 
used: delegation tokens -> "
                                     + "static credentials (if configured) -> 
DefaultCredentialsProvider.");
 
-    @Nullable private Configuration flinkConfig;
-    @Nullable private BucketConfigProvider bucketConfigProvider;
+    @Nullable private volatile Configuration flinkConfig;
+    @Nullable private volatile BucketConfigProvider bucketConfigProvider;

Review Comment:
   Without volatile, the JVM can legally:
     - Cache flinkConfig in a CPU register on thread B's core
     - Never re-read it from main memory
     - Thread B sees null even though thread A wrote a real Configuration



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