Tweaks to dynamic locks (#10508)

* Fix cases where minimum timeout > default timeout.
* Add defensive code for too small/negative timeouts.
* Never set timeout below the maximum value of a request.
* Protect against (unlikely) int64 wraps.
* Decrease timeout slower.
* Don't re-lock before copying.
This commit is contained in:
Klaus Post
2020-09-18 09:18:18 -07:00
committed by GitHub
parent 6f45e303f5
commit c851e022b7
5 changed files with 85 additions and 38 deletions

View File

@@ -31,7 +31,7 @@ const (
leaderLockTimeoutSleepInterval = time.Hour
)
var leaderLockTimeout = newDynamicTimeout(30*time.Second, time.Minute)
var leaderLockTimeout = newDynamicTimeout(1*time.Minute, 30*time.Second)
// NewBgHealSequence creates a background healing sequence
// operation which crawls all objects and heal them.