azure: retry HTTP requests on codes 404, 410, and 429#1807
Merged
travier merged 1 commit intocoreos:mainfrom Feb 9, 2024
Merged
azure: retry HTTP requests on codes 404, 410, and 429#1807travier merged 1 commit intocoreos:mainfrom
travier merged 1 commit intocoreos:mainfrom
Conversation
For some reason, the Azure IMDS server expects clients to retry their HTTP requests even on codes that usually would be considered final. The documented one is 410[[1]], but let's just match the set from cloud-init, which also includes 404 and 429[[2]]. Closes: coreos#1806 [1]: https://learn.microsoft.com/en-us/azure/virtual-machines/instance-metadata-service?tabs=linux#errors-and-debugging [2]: canonical/cloud-init@c1a2047cf291
SudoBrendan
reviewed
Feb 8, 2024
| retryCodes := []int{ | ||
| 404, // not found | ||
| 410, // gone | ||
| 429, // rate-limited |
There was a problem hiding this comment.
idea: we should consider respecting the Retry-After header here so we don't cascade 429 errors (if this isn't already being done somewhere - I see a duration value that could be played with).
Member
Author
There was a problem hiding this comment.
Ideally, yes. We currently do an exponential backoff which will help a lot here at least.
Member
|
We have positive test results that this likely fixes the issue on Azure so I'll merge this PR. We can do a follow-up if that's not enough. Thanks Jonathan for the quick fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For some reason, the Azure IMDS server expects clients to retry their HTTP requests even on codes that usually would be considered final. The documented one is 410[1], but let's just match the set from cloud-init, which also includes 404 and 429[2].
Closes: #1806