File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,12 @@ import (
2626 "time"
2727
2828 "github.com/coreos/go-semver/semver"
29+ "go.uber.org/zap"
30+
2931 pb "go.etcd.io/etcd/api/v3/etcdserverpb"
3032 "go.etcd.io/etcd/server/v3/lease/leasepb"
3133 "go.etcd.io/etcd/server/v3/mvcc/backend"
3234 "go.etcd.io/etcd/server/v3/mvcc/buckets"
33- "go.uber.org/zap"
3435)
3536
3637// NoLease is a special LeaseID representing the absence of a lease.
@@ -912,8 +913,8 @@ func (l *Lease) forever() {
912913
913914// Demoted returns true if the lease's expiry has been reset to forever.
914915func (l * Lease ) Demoted () bool {
915- l .expiryMu .Lock ()
916- defer l .expiryMu .Unlock ()
916+ l .expiryMu .RLock ()
917+ defer l .expiryMu .RUnlock ()
917918 return l .expiry == forever
918919}
919920
You can’t perform that action at this time.
0 commit comments