-
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?
Conversation
…for refreshing credentials earlier due to stale value. This will help prevent returning invalid credentials when an error is encountered during asynchronous refresh.
…for refreshing credentials earlier due to stale value. This will help prevent returning invalid credentials when an error is encountered during asynchronous refresh.
Quality Gate failedFailed conditions |
public ResourcesEndpointRetryPolicy retryPolicy() { | ||
return new ContainerCredentialsRetryPolicy(); | ||
} |
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 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 comment
The 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
@@ -174,7 +178,7 @@ private Instant staleTime(Instant expiration) { | |||
return null; | |||
} | |||
|
|||
return expiration.minusSeconds(1); | |||
return expiration.minus(staleTime); |
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 ?
Add stale time config to
InstanceProfileCredentialsProvider
to allow for refreshing credentials earlier due to stale value. This will help prevent returning invalid credentials when an error is encountered during asynchronous refresh.Motivation and Context
Fixes for #5247 , this will allow user to provide a higher value for prefetch to prevent returning expired credentails without changing default value. Increasing this value may lead to a higher rate of request to IMDS, so we ought to avoid changing the base default value for it.
Modifications
staleTime
configuration option toInstanceProfileCredentialsProvider
InstanceProfileCredentialsProvider
Testing
Added unit tests
Screenshots (if appropriate)
Types of changes