Fix membership lease issue on the etcd3gw driver

The backend driver of etcd3gw doesn't update membership lease
on heartbeat, this patch aligns the implementation with etcd3
driver.

Change-Id: I2a6a11d59c4c82124f4d42391176031656e26528
Closes-Bug: #1839691
This commit is contained in:
Kaifeng Wang 2019-08-10 10:08:33 +08:00
parent a4f1288ee4
commit 55864ed245
1 changed files with 3 additions and 1 deletions

View File

@ -218,7 +218,9 @@ class Etcd3Driver(coordination.CoordinationDriverWithExecutor):
# NOTE(jaypipes): Copying because set can mutate during iteration
for lock in self._acquired_locks.copy():
lock.heartbeat()
return self.lock_timeout
# TODO(kaifeng) use the same lease for locks?
self._membership_lease.refresh()
return min(self.lock_timeout, self.membership_timeout)
def watch_join_group(self, group_id, callback):
raise tooz.NotImplemented