-
Notifications
You must be signed in to change notification settings - Fork 781
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
fix vault retry logic on failed calls #1269
Conversation
56949b1
to
82aeef2
Compare
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.
Overall this looks great. Just the few very minor points.
82aeef2
to
15a502f
Compare
The original problem was that for non-renewable vault secrets that it was having trouble fetching, it would wait the standard exponential backoff time plus the configured sleep time (like it does between successful fetches). When what it should do is use the sleep time between successful fetches and exponential backoff on failures. While fixing this I cleaned up the code to make the logic clear. The issue existed in both vault_read and vault_write, and they shared a common chunk of renew logic between them and with vault_token. So I refactored that out into a common function. Fixes #1224
15a502f
to
14f8395
Compare
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.
LGTM
@mkeeler @eikenb consul-template/dependency/vault_write.go Lines 61 to 64 in a96de95
How this part of code should work at all? We just ignore time channel and always pass through |
In previous implementation version 0.20.0, it was working as expected. consul-template/dependency/vault_write.go Lines 96 to 101 in 9a0f301
|
Hey @vapopvo, thanks for the comments. I missed these at the time but others reported the issue. I just pushed the fix for this in 0.21.3. In the future if you see these things please open a new issue and then reference things like this. I don't check my github notifications every day and can easily miss comments on already merged PRs (or closed issues). Thanks. |
@eikenb good, thanks a lot will do, the template of issues just prevented me to spend time a lot of writing it :) |
The original problem was that for non-renewable vault secrets that it
was having trouble fetching, it would wait the standard exponential
backoff time plus the configured sleep time (like it does between
successful fetches). When what it should do is use the sleep time
between successful fetches and exponential backoff on failures.
While fixing this I cleaned up the code to make the logic clear.
The issue existed in both vault_read and vault_write, and they shared a
common chunk of renew logic between them and with vault_token. So I
refactored that out into a common function.
Fixes #1224