You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (l *containerLock) TrylockWithRetry(ctx context.Context, id string) bool {
var retry = 32
for {
ok := l.Trylock(id)
if ok {
return true
}
// sleep random duration by retry
select {
case <-time.After(time.Millisecond * time.Duration(rand.Intn(retry))):
if retry < 2048 {
retry = retry << 1
}
continue
case <-ctx.Done():
return false
}
}
}
The retry mechanism is not FIFO, so the probability of getting a lock is dependent on the retry intervals. Is this acceptable?
Ⅱ. Describe what happened
Ⅲ. Describe what you expected to happen
Ⅳ. How to reproduce it (as minimally and precisely as possible)
Ⅴ. Anything else we need to know?
Ⅵ. Environment:
pouch version (use pouch version):
OS (e.g. from /etc/os-release):
Kernel (e.g. uname -a):
Install tools:
Others:
The text was updated successfully, but these errors were encountered:
Ⅰ. Issue Description
In #2319 ctrd/container_lock.go:
The retry mechanism is not FIFO, so the probability of getting a lock is dependent on the retry intervals. Is this acceptable?
Ⅱ. Describe what happened
Ⅲ. Describe what you expected to happen
Ⅳ. How to reproduce it (as minimally and precisely as possible)
Ⅴ. Anything else we need to know?
Ⅵ. Environment:
pouch version
):uname -a
):The text was updated successfully, but these errors were encountered: