diff --git a/storage/watchable_store.go b/storage/watchable_store.go index 70ac596fc..83eba9120 100644 --- a/storage/watchable_store.go +++ b/storage/watchable_store.go @@ -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