feat(ec2-metadata-service): add retries for IMDS requests#7569
Merged
feat(ec2-metadata-service): add retries for IMDS requests#7569
Conversation
f4d18da to
c9e9d32
Compare
c9e9d32 to
87890fc
Compare
siddsriv
commented
Dec 12, 2025
kuhe
reviewed
Dec 12, 2025
kuhe
approved these changes
Dec 12, 2025
kuhe
requested changes
Dec 12, 2025
kuhe
reviewed
Dec 15, 2025
kuhe
reviewed
Dec 15, 2025
| await this.backoffFn(attempt); | ||
| const backoffResult = this.backoffFn(attempt); | ||
| if (typeof backoffResult === "number") { | ||
| await this.sleep(backoffResult * 1000); // seconds to milliseconds |
Contributor
There was a problem hiding this comment.
use milliseconds for time, since that is the time unit idiomatic to the language? how is the specification on this?
Collaborator
Author
There was a problem hiding this comment.
spec and the docs here indicate seconds as the ground truth
kuhe
reviewed
Dec 16, 2025
| */ | ||
| disableFetchToken?: boolean; | ||
| /** | ||
| * the number of retry attempts for any failed request, defaulting to 3. |
Contributor
There was a problem hiding this comment.
default attempt count = 4 then?
Collaborator
Author
There was a problem hiding this comment.
yes, 1 initial + 3 retries (by default)
kuhe
approved these changes
Dec 16, 2025
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Issue
Internal JS-5193
Description
Support retries for EC2 IMDS requests and fetching tokens.
Testing
Unit tests:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.