-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS: Enable RetryMode for AWS KMS client #11420
base: main
Are you sure you want to change the base?
Conversation
@nastra @jackye1995 please review it when you have time, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me. I just left a nit about pointing to the documentation (especially about retry mode accepted values).
this.kmsRetryMode = RetryMode.valueOf(KMS_RETRY_MODE_DEFAULT); | ||
} | ||
|
||
public KmsClientProperties(Map<String, String> properties) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would add the link to AWS configBuilder configuration, especially about retry mode (to know the accepted values for retry mode).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbonofre Thank you for your review! I linked to both RetryMode
and ClientOverrideConfiguration
.
Is this really necessary to make configurable? Why shouldn't we just set |
@danielcweeks Thank you for your review.
I am also working on an enhancement to Iceberg S3 doc: #11321, which makes me think users might want to configure AWS service clients with available configurations provided by the client libraries.
Got it, I have no problem with setting Is having too many options a concern to you? I'd like to learn more about your thoughts. Thanks again for your time. |
I feel like the proliferation of options is not a good thing unless there's real value being added. This doesn't seem to be one of those cases. Rather than adding a lot of boilerplate configuration, I would suggest just setting this at |
Thanks for your feedback @danielcweeks Please take a look again. If you still have time, I have another PR for you #11321 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hsiang-c I agree with @danielcweeks that we need to be cautious when adding new properties, specifically what that means is evaluating if it's a valuable knob that's worth adding. In this case we know that we generally want to retry when throttled and the recommended strategy is adaptive so the produced clients should just do that without exposing things to users.
Overall this PR looks to be a good direction, just had a comment that I don't think the public KmsClientProperties class is needed at the moment.
import software.amazon.awssdk.core.retry.RetryMode; | ||
import software.amazon.awssdk.services.kms.KmsClientBuilder; | ||
|
||
public class KmsClientProperties implements Serializable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this class considering there's no separate properties we're introducing for KMS and the fact that it may make sense to also apply ADAPTIVE_V2 for Glue client as well (not needed in this PR, but down the line we could just use that)? Just don't want to avoid public properties classes until they're really necessary
I think an applyRetryConfigurations in the existing AwsClientProperties
also would work well since that class is meant for generalizing across the different AWS clients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amogh-jahagirdar Thank you for your feedback.
Making applyRetryConfigurations
as part of AwsClientProperties
makes sense to me.
RetryMode
.RetryPolicy
b/c it is deprecated.