mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
storage/watchable_store: defer to Unlock s.mu
New PR from https://github.com/coreos/etcd/pull/3575. This add `defer` to `s.mu`. Current code does not `Unlock` in the correct scope, I think. (Sorry, I accidentally deleted my fork so the changes might not sound continuous from my previous pull requests.)
This commit is contained in:
parent
89acdd6245
commit
4113509828
@ -177,7 +177,7 @@ func (s *watchableStore) Watcher(key []byte, prefix bool, startRev, endRev int64
|
||||
|
||||
cancel := CancelFunc(func() {
|
||||
s.mu.Lock()
|
||||
s.mu.Unlock()
|
||||
defer s.mu.Unlock()
|
||||
wa.stopWithError(ErrCanceled)
|
||||
|
||||
// remove global references of the watcher
|
||||
|
Loading…
x
Reference in New Issue
Block a user