Skip to content

Conversation

@chlowell
Copy link
Member

Closes #24842 with a small tweak to IMDS retry configuration. Our retry policy doesn't allow setting retry options based on a response, so this PR allows another retry in any case and shortens the MaxRetryDelay so the total retry period is about 70 seconds.

Here's a sample of the change's effect. Delays for retries 1-3 are unchanged (jitter causes the variation) but now there's a 5th retry, which like the 4th is limited to 25s.

Retry Delay before Delay after
1     2.11s          1.71s        
2     5.69s          7.46s        
3     12.37s         13.38s       
4     31.80s         25.00s       
5     —              25.00s       
Total 51.97s     72.55s     

@chlowell chlowell self-assigned this Jun 26, 2025
@chlowell chlowell marked this pull request as ready for review June 27, 2025 18:57
Copilot AI review requested due to automatic review settings June 27, 2025 18:57
@chlowell chlowell requested review from a team, RickWinter and jhendrixMSFT as code owners June 27, 2025 18:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adjusts the IMDS retry behavior for ManagedIdentityCredential by extending the retry count, reducing the maximum backoff delay, and updating the changelog to reflect the new ~70-second retry window.

  • Increased the default MaxRetries from 5 to 6
  • Reduced the default MaxRetryDelay from 1 minute to 25 seconds
  • Removed the default TryTimeout setting and documented the ~70s retry period in CHANGELOG

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
sdk/azidentity/managed_identity_client.go Bumped default retries, shrank max delay, removed TryTimeout default
sdk/azidentity/CHANGELOG.md Added entry noting ~70s total IMDS retry duration
Comments suppressed due to low confidence (2)

sdk/azidentity/managed_identity_client.go:84

  • By removing the default TryTimeout, requests may no longer time out as intended and could hang indefinitely. Consider reinstating or documenting this default timeout behavior.
	}

sdk/azidentity/CHANGELOG.md:16

  • The markdown bullet has an extra - after the diff marker (+-). Please correct it to a single - and ensure consistent indentation for the wrapped line.
- By default, `ManagedIdentityCredential` retries IMDS requests for a maximum of ~70 seconds as recommended

@github-project-automation github-project-automation bot moved this from Untriaged to In Progress in Azure Identity SDK Improvements Jul 1, 2025
@chlowell chlowell merged commit f2db0f0 into Azure:main Jul 2, 2025
11 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Azure Identity SDK Improvements Jul 2, 2025
@chlowell chlowell deleted the 410 branch July 2, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

ManagedIdentityCredential retry policy should handle 410 status response

2 participants