mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
mvcc: Add Unlock before panic to prevent double lock
This commit is contained in:
parent
84e2788c2e
commit
235d7c2e51
@ -427,6 +427,7 @@ func (s *store) restore() error {
|
||||
|
||||
for key, lid := range keyToLease {
|
||||
if s.le == nil {
|
||||
tx.Unlock()
|
||||
panic("no lessor to attach lease")
|
||||
}
|
||||
err := s.le.Attach(lid, []lease.LeaseItem{{Key: key}})
|
||||
|
@ -159,6 +159,7 @@ func (s *watchableStore) cancelWatcher(wa *watcher) {
|
||||
}
|
||||
|
||||
if !wa.victim {
|
||||
s.mu.Unlock()
|
||||
panic("watcher not victim but not in watch groups")
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user