mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #11300 from lzhfromustc/MU_mvcc2
mvcc: Add Unlock before panic to prevent double lock
This commit is contained in:
commit
fa972cf296
@ -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