Add default retry for load config via url#8803
Merged
helenosheaa merged 2 commits intomasterfrom Feb 12, 2021
Merged
Conversation
ivorybilled
reviewed
Feb 5, 2021
ivorybilled
approved these changes
Feb 5, 2021
ssoroka
reviewed
Feb 11, 2021
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++ { |
Contributor
There was a problem hiding this comment.
if retries is 0, this won't attempt at all. If we later move to user-configurable retries, that won't quite make sense
Member
Author
There was a problem hiding this comment.
Right changed i to 0
ssoroka
approved these changes
Feb 12, 2021
This was referenced Aug 13, 2021
arstercz
pushed a commit
to arstercz/telegraf
that referenced
this pull request
Mar 5, 2023
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.
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.