mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-03 20:40:45 -05:00
Fix exponential backoff for api.LifetimeWatcher (#26383)
* Fix exponential backoff for api.LifetimeWatcher * Add changelog entry
This commit is contained in:
parent
e94163e475
commit
57cb563be5
2 changed files with 8 additions and 2 deletions
|
|
@ -349,8 +349,11 @@ func (r *LifetimeWatcher) doRenewWithOptions(tokenMode bool, nonRenewable bool,
|
|||
|
||||
if errorBackoff == nil {
|
||||
sleepDuration = r.calculateSleepDuration(remainingLeaseDuration, priorDuration)
|
||||
} else if errorBackoff.NextBackOff() == backoff.Stop {
|
||||
return err
|
||||
} else {
|
||||
sleepDuration = errorBackoff.NextBackOff()
|
||||
if sleepDuration == backoff.Stop {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
```
|
||||
Loading…
Reference in a new issue