Fix for age calculation on unused nodes

Setting the node state automatically changes the state_time
attribute for us, so our age calculation is always at 0 when
we go to log how old the node is at delete time. Fix it so
that we set state *after* logging the age.

Change-Id: I6e0510405f43842529c733110378b96decb88a07
This commit is contained in:
David Shrewsbury 2018-02-06 09:10:25 -05:00
parent 0ff94fa98b
commit f1f55e4638
1 changed files with 1 additions and 1 deletions

View File

@ -1691,10 +1691,10 @@ class ZooKeeper(object):
self.unlockNode(node)
continue
node.state = DELETING
try:
self.log.debug("Deleting unused node %s (age: %s)",
node.id, age(node.state_time))
node.state = DELETING
self.storeNode(node)
except Exception:
self.log.exception(