Handle missing node during hold check
A node can get removed from underneath us when we iterate through all of them. Handle that better. Change-Id: I28eb479eba4d59ef15e53c99f2abb58fb669ad39
This commit is contained in:
parent
330d40e4c1
commit
95784a6630
|
@ -283,7 +283,12 @@ class ZooKeeper(object):
|
|||
count = 0
|
||||
for nodeid in nodes:
|
||||
node_path = '%s/%s' % (self.NODE_ROOT, nodeid)
|
||||
node_data, node_stat = self.client.get(node_path)
|
||||
try:
|
||||
node_data, node_stat = self.client.get(node_path)
|
||||
except kze.NoNodeError:
|
||||
# Node got removed on us. Just ignore.
|
||||
continue
|
||||
|
||||
if not node_data:
|
||||
self.log.warning("Node ID %s has no data", nodeid)
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue