You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #26868, the backoff package was upgraded to V4. Part of the difference between V3 and V4 of backoff is that the backoff.ExponentialBackOff struct now takes a "Stop" field, indicating the value to return when we should no longer retry the operation.
The lifetime watcher later checks the returned value from the backoff to see if it's backoff.Stop. It never is, as the ExponentialBackoff we've initialised returns a time.Duration of zero seconds.
To Reproduce
Try to use the lifetime watcher and have it error out when we've unsuccessfully retried to renew the lease and the lease duration has expired.
The text was updated successfully, but these errors were encountered:
jSherz
changed the title
Exponential backoff in the LifetimeWatcher is broken
Exponential backoff in the LifetimeWatcher does not send an error to doneCh if we reach the lease expiration while failing to renew
Oct 7, 2024
Describe the bug
In #26868, the backoff package was upgraded to V4. Part of the difference between V3 and V4 of backoff is that the backoff.ExponentialBackOff struct now takes a "Stop" field, indicating the value to return when we should no longer retry the operation.
In the constructor they provide (backoff.NewExpontentialBackOff - https://github.com/cenkalti/backoff/blob/v4/exponential.go#L94), the Stop value is set to the constant in the package, a duration of -1 second. The Vault code however directly initialises the struct (https://github.com/hashicorp/vault/blob/c8e6169d5dbc82d99d904e468852902de98ebfd0/api/lifetime_watcher.go) and thus we end up with a duration of zero seconds for the "Stop" field.
The lifetime watcher later checks the returned value from the backoff to see if it's
backoff.Stop
. It never is, as the ExponentialBackoff we've initialised returns a time.Duration of zero seconds.To Reproduce
Expected behavior
r.doneCh
should receive an error.Environment:
The text was updated successfully, but these errors were encountered: