Do not block on distributed unlocks (#19952)
* Prevents blocking when losing quorum (standard on cluster restarts). * Time out to prevent endless buildup. Timed-out remote locks will be canceled because they miss the refresh anyway. * Reduces latency for all calls since the wall time for the roundtrip to remotes no longer adds to the requests.
This commit is contained in:
@@ -293,6 +293,8 @@ func TestUnlockShouldNotTimeout(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
|
||||
defer cancel()
|
||||
dm.Unlock(ctx)
|
||||
// Unlock is not blocking. Try to get a new lock.
|
||||
dm.GetLock(ctx, nil, id, source, Options{Timeout: 5 * time.Minute})
|
||||
unlockReturned <- struct{}{}
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user