Skip to content

Commit

Permalink
Merge pull request #10161 from jingyih/automated-cherry-pick-of-#1015…
Browse files Browse the repository at this point in the history
…3-origin-release-3.3

clientv3: automated cherry pick of #10153 to release-3.3
  • Loading branch information
jingyih committed Oct 9, 2018
2 parents cb57901 + 20d83e4 commit ebe950f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions clientv3/concurrency/mutex.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ func (m *Mutex) Lock(ctx context.Context) error {

// wait for deletion revisions prior to myKey
hdr, werr := waitDeletes(ctx, client, m.pfx, m.myRev-1)
// release lock key if cancelled
select {
case <-ctx.Done():
// release lock key if wait failed
if werr != nil {
m.Unlock(client.Ctx())
default:
} else {
m.hdr = hdr
}
return werr
Expand Down

0 comments on commit ebe950f

Please sign in to comment.