Commit Graph

4 Commits (0461b3fa51ebcd3f72ef54296638ac2f19ea9071)

Author SHA1 Message Date
nolouch dc8a31eaf0 lease/lessor: recheck if exprired lease is revoked
Signed-off-by: nolouch <nolouch@gmail.com>
2019-05-29 14:27:19 +08:00
Joe Betz 2edb954bce
lease: Checkpoint lease TTLs to prevent indefinite auto-renewal of long lived leases 2018-07-23 16:12:34 -07:00
Gyuho Lee 51b8d68a7f lease: godoc "LeaseWithTime", change field name to "id"
No need to have "lease" in field name.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-02 14:58:34 -07:00
micah 6f271d8bf1 lease: Add a heap to optimize lease expiration checks
This adds a heap acting as a priority queue to keep track of lease
exiprations. Previously the whole lease map had to be iterated through
each time.

The queue allows us to check only those leases which might be expired.
When the expiration changes, we add an additional entry. If we check an
entry that isn't expired, it means that the lease got extended.
If we find a entry in the heap that doesn't have a corresponding entry in
the map, we know that the lease has already been expired or revoked.
2018-04-02 11:52:55 -07:00