-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default retry for load config via url #8803
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤝 ✅ CLA has been signed. Thank you!
config/config.go
Outdated
if resp.StatusCode != http.StatusOK { | ||
return nil, fmt.Errorf("failed to retrieve remote config: %s", resp.Status) | ||
retries := 3 | ||
for i := 1; i <= retries; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if retries is 0, this won't attempt at all. If we later move to user-configurable retries, that won't quite make sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right changed i to 0
Closes #7338
Related #7349, #7662
This is a temporary fix which we intend to improve on:
Retries three times at 10s intervals when receiving an error on loading config from a url incase of the endpoint being down.
Log attempts and the specific failure response codes.
Does not use env variables or add new flags
Tests added to demonstrate that on the final failure it will return the error.