NathanCYee commented on code in PR #16794:
URL: https://github.com/apache/iceberg/pull/16794#discussion_r3553752368


##########
aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java:
##########
@@ -292,12 +302,15 @@ public AwsProperties(Map<String, String> properties) {
             properties, CLIENT_ASSUME_ROLE_TIMEOUT_SEC, 
CLIENT_ASSUME_ROLE_TIMEOUT_SEC_DEFAULT);
     this.clientAssumeRoleExternalId = 
properties.get(CLIENT_ASSUME_ROLE_EXTERNAL_ID);
     this.clientAssumeRoleRegion = properties.get(CLIENT_ASSUME_ROLE_REGION);
-    this.clientAssumeRoleSessionName = 
properties.get(CLIENT_ASSUME_ROLE_SESSION_NAME);
+    this.clientAssumeRoleSessionName =
+        properties.getOrDefault(
+            CLIENT_ASSUME_ROLE_SESSION_NAME, String.format("iceberg-aws-%s", 
UUID.randomUUID()));

Review Comment:
   I reverted back to lazily generating the session name in the latest change, 
but I created a private UUID so that the randomized session name is stable 
across lazy generations for the lifetime of AwsProperties.
   
   This matches the random name generation used in other places like 
[AliyunOSSExtension](https://github.com/apache/iceberg/blob/5f154712f799a0b24d4d2dac8d889de67aefa051/aliyun/src/test/java/org/apache/iceberg/aliyun/oss/AliyunOSSExtension.java#L34)
 and (to a lesser degree) 
[BaseMetadataTable](https://github.com/apache/iceberg/blob/5f154712f799a0b24d4d2dac8d889de67aefa051/core/src/main/java/org/apache/iceberg/BaseMetadataTable.java#L66).
 



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