mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3/concurrency: do not swallow error (#11458)
This commit is contained in:
parent
be103ea558
commit
b41711276e
@ -82,12 +82,11 @@ func (m *Mutex) Lock(ctx context.Context) error {
|
|||||||
client := m.s.Client()
|
client := m.s.Client()
|
||||||
// wait for deletion revisions prior to myKey
|
// wait for deletion revisions prior to myKey
|
||||||
// TODO: early termination if the session key is deleted before other session keys with smaller revisions.
|
// TODO: early termination if the session key is deleted before other session keys with smaller revisions.
|
||||||
hdr, werr := waitDeletes(ctx, client, m.pfx, m.myRev-1)
|
_, werr := waitDeletes(ctx, client, m.pfx, m.myRev-1)
|
||||||
// release lock key if wait failed
|
// release lock key if wait failed
|
||||||
if werr != nil {
|
if werr != nil {
|
||||||
m.Unlock(client.Ctx())
|
m.Unlock(client.Ctx())
|
||||||
} else {
|
return werr
|
||||||
m.hdr = hdr
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure the session is not expired, and the owner key still exists.
|
// make sure the session is not expired, and the owner key still exists.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user