nastra commented on code in PR #16109:
URL: https://github.com/apache/iceberg/pull/16109#discussion_r3154253339


##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java:
##########
@@ -109,8 +110,9 @@ public class S3FileIO
   private MetricsContext metrics = MetricsContext.nullMetrics();
   private final AtomicBoolean isResourceClosed = new AtomicBoolean(false);
   private transient StackTraceElement[] createStack;
-  // use modifiable collection for Kryo serde
-  private volatile List<StorageCredential> storageCredentials = 
Lists.newArrayList();
+  // CopyOnWriteArrayList gives a safe snapshot view for readers iterating 
outside
+  // the synchronized block in clientByPrefix() and is Kryo-serialisable
+  private volatile List<StorageCredential> storageCredentials = new 
CopyOnWriteArrayList<>();

Review Comment:
   I don't think switching this to a `CopyOnWriteArrayList` is the right 
approach just because an LLM flagged this as being a good idea to do



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to