libkv icon indicating copy to clipboard operation
libkv copied to clipboard

A race is possible in etcd's Lock()

Open debedb opened this issue 8 years ago • 1 comments

Consider line 499:

l.last, err = l.client.Set(context.Background(), l.key, l.value, setOpts)

It is possible for Set() to succeed, and immediately the following call to Set() from a different goroutine to fail - modifying l.last to be nil. Which will then result in Unlock() not issuing a Delete call and so not unlocking.

debedb avatar Aug 03 '17 18:08 debedb

I think this is fixed by #186

jlhawn avatar Dec 19 '17 19:12 jlhawn