mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
Fix exponential backoff for api.LifetimeWatcher (#26383)
* Fix exponential backoff for api.LifetimeWatcher * Add changelog entry
This commit is contained in:
@@ -349,8 +349,11 @@ func (r *LifetimeWatcher) doRenewWithOptions(tokenMode bool, nonRenewable bool,
|
|||||||
|
|
||||||
if errorBackoff == nil {
|
if errorBackoff == nil {
|
||||||
sleepDuration = r.calculateSleepDuration(remainingLeaseDuration, priorDuration)
|
sleepDuration = r.calculateSleepDuration(remainingLeaseDuration, priorDuration)
|
||||||
} else if errorBackoff.NextBackOff() == backoff.Stop {
|
} else {
|
||||||
return err
|
sleepDuration = errorBackoff.NextBackOff()
|
||||||
|
if sleepDuration == backoff.Stop {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// remainingLeaseDuration becomes the priorDuration for the next loop
|
// remainingLeaseDuration becomes the priorDuration for the next loop
|
||||||
|
|||||||
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