danielcweeks commented on code in PR #15678:
URL: https://github.com/apache/iceberg/pull/15678#discussion_r2961001351


##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java:
##########
@@ -559,8 +664,21 @@ private boolean recoverObject(PrefixedS3Client client, 
ObjectVersion version, St
   @Override
   public void setCredentials(List<StorageCredential> credentials) {
     Preconditions.checkArgument(credentials != null, "Invalid storage 
credentials: null");
+    // stop any refresh that might be scheduled
+    if (refreshFuture != null) {
+      refreshFuture.cancel(true);
+    }
+
     // copy credentials into a modifiable collection for Kryo serde
     this.storageCredentials = Lists.newArrayList(credentials);
+
+    // if the clients are already initialized, we need to close and allow them 
to be recreated

Review Comment:
   > invalidating the clients makes sense to me. Maybe worth extracting it into 
a separate method so that it can also be called from inside 
`refreshStorageCredentials()`
   
   We actually shouldn't invalidate at refresh because the vended credential 
providers already do that.  We would be needlessly recreating the clients.  The 
only time we need to do anything is if the credentials are reset externally 
(thinking about future `setCredentials` on table commit for example).



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