mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #10162 from jingyih/automated-cherry-pick-of-#10153-origin-release-3.2
clientv3: automated cherry pick of #10153 to release-3.2
This commit is contained in:
commit
afa5beda46
@ -69,11 +69,10 @@ func (m *Mutex) Lock(ctx context.Context) error {
|
|||||||
|
|
||||||
// wait for deletion revisions prior to myKey
|
// wait for deletion revisions prior to myKey
|
||||||
hdr, werr := waitDeletes(ctx, client, m.pfx, m.myRev-1)
|
hdr, werr := waitDeletes(ctx, client, m.pfx, m.myRev-1)
|
||||||
// release lock key if cancelled
|
// release lock key if wait failed
|
||||||
select {
|
if werr != nil {
|
||||||
case <-ctx.Done():
|
|
||||||
m.Unlock(client.Ctx())
|
m.Unlock(client.Ctx())
|
||||||
default:
|
} else {
|
||||||
m.hdr = hdr
|
m.hdr = hdr
|
||||||
}
|
}
|
||||||
return werr
|
return werr
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user