Skip to content

Commit b912ba9

Browse files
committed
Adding comment
1 parent 8708d80 commit b912ba9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/auth/src/main/java/software/amazon/awssdk/auth/credentials/InstanceProfileCredentialsProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ private RefreshResult<AwsCredentials> refreshCredentials() {
176176
Instant expiration = credentials.getExpiration().orElse(null);
177177
log.debug(() -> "Loaded credentials from IMDS with expiration time of " + expiration);
178178

179+
// Reset profile retry count after successful credential fetch
179180
profileRetryCount = 0;
180181

181182
return RefreshResult.builder(credentials.getAwsCredentials())
@@ -194,7 +195,7 @@ private RefreshResult<AwsCredentials> refreshCredentials() {
194195

195196
profileRetryCount++;
196197
if (profileRetryCount <= MAX_PROFILE_RETRIES) {
197-
log.debug(() -> "Retrying fetching the profile name again");
198+
log.debug(() -> "Profile name not found, retrying fetching the profile name again.");
198199
return refreshCredentials();
199200
}
200201
throw SdkClientException.create(FAILED_TO_LOAD_CREDENTIALS_ERROR, e);

0 commit comments

Comments
 (0)