diff --git a/storage/watchable_store.go b/storage/watchable_store.go index fef796008..2f0a0578e 100644 --- a/storage/watchable_store.go +++ b/storage/watchable_store.go @@ -324,7 +324,6 @@ func (s *watchableStore) syncWatchers() { tx := s.store.b.BatchTx() tx.Lock() ks, vs := tx.UnsafeRange(keyBucketName, minBytes, maxBytes, 0) - tx.Unlock() evs := []storagepb.Event{} @@ -351,6 +350,7 @@ func (s *watchableStore) syncWatchers() { evs = append(evs, ev) } + tx.Unlock() for w, es := range newWatcherToEventMap(s.unsynced, evs) { select {