vendor: update buildkit to v0.14.0

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2024-06-11 09:56:59 -07:00
parent 875e4cd52e
commit 85c25f719c
8 changed files with 78 additions and 50 deletions

View File

@ -3,7 +3,7 @@ package flightcontrol
import (
"context"
"io"
"runtime"
"math/rand"
"sort"
"sync"
"time"
@ -43,13 +43,14 @@ func (g *Group[T]) Do(ctx context.Context, key string, fn func(ctx context.Conte
err = errors.Wrapf(errRetryTimeout, "flightcontrol")
return v, err
}
runtime.Gosched()
if backoff > 0 {
time.Sleep(backoff)
backoff *= 2
backoff = time.Duration(float64(backoff) * 1.2)
} else {
backoff = time.Millisecond
// randomize initial backoff to avoid all goroutines retrying at once
//nolint:gosec // using math/rand pseudo-randomness is acceptable here
backoff = time.Millisecond + time.Duration(rand.Intn(1e7))*time.Nanosecond
}
time.Sleep(backoff)
}
}