Skip to content
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

Improving CredentialsCache ExpiryWindow and ExpiryWindowJitterFrac Behaviors #949

Closed
skmcgrail opened this issue Dec 4, 2020 · 1 comment
Labels
closed-for-staleness feature-request A feature should be added or improved.

Comments

@skmcgrail
Copy link
Member

skmcgrail commented Dec 4, 2020

CredentialsCache allows users to artificially adjust the expiration of credentials by adjusting them to be marked as expired by some duration value prior to their original date/time. Additionally this window duration can be randomized by some amount by providing a percentage value for ExpiryWindowJitterFrac. This allows for some randomness to the artificial refresh window.

A downside to this behavior, which has always been present in the SDKs support for expiration windows, is that it has the potential to attempt to refresh the credentials each time until the underlying provider returns a new credential pair with a new expiration window, or an error occurs from the underlying provider.

A more desirable behavior would be for credentials object to not have its expiration time artificially adjusted, but instead have the CredentialsCache to store this information internally. When credentials are retrieved from the cache and are found to be in the ExpirationWindow, the still valid credentials would be returned to the caller immediately, and background goroutine would be spun off to attempt to refresh the credentials. There would only ever be a single refresh occurring at one time, and could be enforced via the singleflight group. Additionally, the window would be adjusted appropriately to prevent situations where the background refresh received the same credentials from the underlying provider. This "backoff" strategy would still allow for more proactive refreshing within the window, but would provide a cool-down period to avoid a continual stream of requests to the underlying provider.

Related: #946

@skmcgrail skmcgrail added the feature-request A feature should be added or improved. label Dec 4, 2020
@github-actions
Copy link

github-actions bot commented Dec 8, 2021

We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

1 participant