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.
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
agent: restart template runner on retry for unlimited retries #11775
agent: restart template runner on retry for unlimited retries #11775
Changes from 20 commits
2609f7c
a521f1d
83e2d94
20af485
4c23bad
b346dd8
89fa90d
0b834db
518ed86
27df22b
300dc8c
3cf2e48
310f564
d7b42ac
4f673d8
ddccb43
b7ecf45
3657ea6
ffe15f5
1440475
9a73bb5
69b3204
5d41bee
8e6be32
b3dea46
08be22d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This logic over here is what allows agent to perform a reasonable number of retries with enough backoff pause towards the tail end of the runner's current run before restarting. I've chosen
ctconfig.DefaultRetryAttempts
as the value since that was always the case on Agent 1.5.x and earlier. We can't completely hand off retries to the cache's proxy because the API client only performs retries on 5xx errors whereas the builtin retry logic from consul-template performs retries on any errors. A non-existent secret (i.e. a 404) without retry attempts from consul-template itself will spam apiproxy, and in turn the server, with requests indefinitely which can easily DDoS Vault.The alternative here could be to set
attempts = sc.AgentConfig.Vault.Retry.NumRetries
but it has the danger of spamming the server with requests if the value is too low or zero due to low initial backoff values.