-
Notifications
You must be signed in to change notification settings - Fork 858
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
Add stale time config to InstanceProfileCredentialsProvider #5758
base: master
Are you sure you want to change the base?
Changes from all commits
a105c89
da296ca
551a520
199713c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
import java.util.Optional; | ||
import software.amazon.awssdk.annotations.SdkInternalApi; | ||
import software.amazon.awssdk.regions.util.ResourcesEndpointProvider; | ||
import software.amazon.awssdk.regions.util.ResourcesEndpointRetryPolicy; | ||
import software.amazon.awssdk.utils.Validate; | ||
|
||
@SdkInternalApi | ||
|
@@ -58,6 +59,11 @@ public Map<String, String> headers() { | |
return Collections.unmodifiableMap(headers); | ||
} | ||
|
||
@Override | ||
public ResourcesEndpointRetryPolicy retryPolicy() { | ||
return new ContainerCredentialsRetryPolicy(); | ||
} | ||
Comment on lines
+63
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we can add retry at this point for IMDS credentials provider because it may increase latency and break customers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right, that was a ask from Hadoop. Instead we can add it as an optional config as well |
||
|
||
public static class Builder { | ||
private URI endpoint; | ||
private Map<String, String> additionalHeaders = new HashMap<>(); | ||
|
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.
I was trying to understand comment in #3314 (comment)
Looks like the 1 sec is intentional , if a user configures an excessively large stale time (e.g., expiration.minusMinutes(10)), credentials might be marked as stale too early, causing unnecessary refreshes and increased load on the credential provider. WDYT ?