Skip to content
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

Merged
merged 2 commits into from
Feb 12, 2021
Merged

Conversation

helenosheaa
Copy link
Member

@helenosheaa helenosheaa commented Feb 4, 2021

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.

Copy link
Contributor

@telegraf-tiger telegraf-tiger bot left a 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!

@helenosheaa helenosheaa added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Feb 4, 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++ {
Copy link
Contributor

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

Copy link
Member Author

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

config/config.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent won't start if remote HTTP config endpoint is down
3 participants