reduce startup delays on kubernetes (#16356)

This commit is contained in:
Harshavardhana
2023-01-05 02:32:43 -08:00
committed by GitHub
parent b29e159604
commit e0086c1be7
3 changed files with 51 additions and 5 deletions

View File

@@ -399,10 +399,14 @@ func initServer(ctx context.Context, newObject ObjectLayer) error {
lkctx, err := txnLk.GetLock(ctx, lockTimeout)
if err != nil {
logger.Info("Waiting for all MinIO sub-systems to be initialized.. trying to acquire lock")
waitDuration := time.Duration(r.Float64() * 2 * float64(time.Second))
waitDuration := time.Duration(r.Float64() * 5 * float64(time.Second))
bootstrapTrace(fmt.Sprintf("lock not available. error: %v. sleeping for %v before retry", err, waitDuration))
// Sleep 0 -> 2 seconds to average 1 second retry interval.
// Sleep 0 -> 5 seconds, provider a higher range such that sleeps()
// and retries for lock are more spread out, needed orchestrated
// systems take 30s minimum to respond to DNS resolvers.
//
// Do not change this value.
time.Sleep(waitDuration)
continue
}