Closed mash closed 7 years ago
Good find!
Apologies for reviving this, but it seems the fix is incomplete, and retries are not being reset for the consul-template vault token, but only for secrets fetched from Vault. That is, nothing reset the retries here: https://github.com/hashicorp/consul-template/blob/master/dependency/vault_token.go#L71
Consul Template version
Configuration
Command
Debug output
I can collect a trace log but after looking into code I think it's obvious.
Expected behavior
I'm setting the attempts config large enough so that consul-template can withstand a consul server re-election.
The retries variable in
poll
func https://github.com/hashicorp/consul-template/blob/master/watch/view.go#L108 should reset to 0 when consul-template receives a successful response from consul.Actual behavior
There are few code paths in
fetch
func https://github.com/hashicorp/consul-template/blob/master/watch/view.go#L186 that continues the for loop when the response (I guess) should be considered successful.For example when nothing changed within the wait=60000ms period https://github.com/hashicorp/consul-template/blob/master/watch/view.go#L218
In those continue cases, the retries variable in
poll
func is not reset to 0, so fetch failure sums up and eventually reaches the retries count.Steps to reproduce