Update etcd client to 3.2.24 for latest release
Signed-off-by: Timothy St. Clair <timothysc@gmail.com>
This commit is contained in:
14
vendor/github.com/coreos/etcd/lease/lessor.go
generated
vendored
14
vendor/github.com/coreos/etcd/lease/lessor.go
generated
vendored
@@ -35,15 +35,19 @@ const (
|
||||
forever = monotime.Time(math.MaxInt64)
|
||||
)
|
||||
|
||||
// MaxLeaseTTL is the maximum lease TTL value
|
||||
const MaxLeaseTTL = 9000000000
|
||||
|
||||
var (
|
||||
leaseBucketName = []byte("lease")
|
||||
|
||||
// maximum number of leases to revoke per second; configurable for tests
|
||||
leaseRevokeRate = 1000
|
||||
|
||||
ErrNotPrimary = errors.New("not a primary lessor")
|
||||
ErrLeaseNotFound = errors.New("lease not found")
|
||||
ErrLeaseExists = errors.New("lease already exists")
|
||||
ErrNotPrimary = errors.New("not a primary lessor")
|
||||
ErrLeaseNotFound = errors.New("lease not found")
|
||||
ErrLeaseExists = errors.New("lease already exists")
|
||||
ErrLeaseTTLTooLarge = errors.New("too large lease TTL")
|
||||
)
|
||||
|
||||
// TxnDelete is a TxnWrite that only permits deletes. Defined here
|
||||
@@ -199,6 +203,10 @@ func (le *lessor) Grant(id LeaseID, ttl int64) (*Lease, error) {
|
||||
return nil, ErrLeaseNotFound
|
||||
}
|
||||
|
||||
if ttl > MaxLeaseTTL {
|
||||
return nil, ErrLeaseTTLTooLarge
|
||||
}
|
||||
|
||||
// TODO: when lessor is under high load, it should give out lease
|
||||
// with longer TTL to reduce renew load.
|
||||
l := &Lease{
|
||||
|
||||
Reference in New Issue
Block a user