mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
Fix exponential backoff for api.LifetimeWatcher (#26383)
* Fix exponential backoff for api.LifetimeWatcher * Add changelog entry
This commit is contained in:
@@ -349,9 +349,12 @@ func (r *LifetimeWatcher) doRenewWithOptions(tokenMode bool, nonRenewable bool,
|
||||
|
||||
if errorBackoff == nil {
|
||||
sleepDuration = r.calculateSleepDuration(remainingLeaseDuration, priorDuration)
|
||||
} else if errorBackoff.NextBackOff() == backoff.Stop {
|
||||
} else {
|
||||
sleepDuration = errorBackoff.NextBackOff()
|
||||
if sleepDuration == backoff.Stop {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// remainingLeaseDuration becomes the priorDuration for the next loop
|
||||
priorDuration = remainingLeaseDuration
|
||||
|
||||
3
changelog/26383.txt
Normal file
3
changelog/26383.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
api: fixed a bug where LifetimeWatcher routines weren't respecting exponential backoff in the presence of unexpected errors
|
||||
```
|
||||
Reference in New Issue
Block a user