Skip to content

InstanceCredentialsProvider does not eagerlyFetch #2239

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

Closed
ghost opened this issue Feb 27, 2020 · 2 comments
Closed

InstanceCredentialsProvider does not eagerlyFetch #2239

ghost opened this issue Feb 27, 2020 · 2 comments
Labels
closing-soon This issue will close in 2 days unless further comments are made. guidance Question that needs advice or information. response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days.

Comments

@ghost
Copy link

ghost commented Feb 27, 2020

I've been debugging an issue where we observe increased latency during our first DynamoDB request. We are using the InstanceCredentialsProvider from the 1.11 AWS SDK and instantiating it with true for the first parameter.

In reviewing the source code it seems that this calls a private constructor that takes two boolean parameters, the second being eagerlyRefreshCredentialsAsync. Unfortunately this parameter is ignored and shouldRefresh is set to false, therefore the credentials are not actually fetched until they are used.

If the credentials were to be eagerly fetched (as it seems was intended), then our application would not suffer this latency hit on the first customer request. As it is we will need to work around this by eagerly calling getCredentials ourself.

https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/java/com/amazonaws/auth/InstanceProfileCredentialsProvider.java#L100

@debora-ito
Copy link
Member

@debora-ito debora-ito added guidance Question that needs advice or information. response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days. closing-soon This issue will close in 2 days unless further comments are made. labels Mar 3, 2020
@debora-ito
Copy link
Member

Closing due to no response. Feel free to reopen if you have further questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will close in 2 days unless further comments are made. guidance Question that needs advice or information. response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days.
Projects
None yet
Development

No branches or pull requests

1 participant