InstanceCredentialsProvider does not eagerlyFetch #2239
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.
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 withtrue
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 andshouldRefresh
is set tofalse
, 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
The text was updated successfully, but these errors were encountered: