mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fix runlock bug
This commit is contained in:
parent
7572a61a39
commit
7e6c29c198
@ -355,8 +355,11 @@ func (s *watchableStore) syncWatchers() int {
|
||||
tx := s.store.b.ReadTx()
|
||||
tx.RLock()
|
||||
revs, vs := tx.UnsafeRange(schema.Key, minBytes, maxBytes, 0)
|
||||
tx.RUnlock()
|
||||
evs := kvsToEvents(s.store.lg, wg, revs, vs)
|
||||
// Must unlock after kvsToEvents, because vs (come from boltdb memory) is not deep copy.
|
||||
// We can only unlock after Unmarshal, which will do deep copy.
|
||||
// Otherwise we will trigger SIGSEGV during boltdb re-mmap.
|
||||
tx.RUnlock()
|
||||
|
||||
victims := make(watcherBatch)
|
||||
wb := newWatcherBatch(wg, evs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user