Commit cfe1b5ca authored by Julien Muchembled's avatar Julien Muchembled

client: small optimization when iterating over storage connections

parent 11d83ad9
......@@ -93,9 +93,11 @@ class ConnectionPool(object):
if uuid in self.connection_dict:
return CELL_CONNECTED
failure = self.node_failure_dict.get(uuid)
if failure is None or failure < time.time():
return CELL_GOOD
return CELL_FAILED
if failure:
if time.time() < failure:
return CELL_FAILED
self.node_failure_dict.pop(uuid, None)
return CELL_GOOD
def getConnForCell(self, cell):
return self.getConnForNode(cell.getNode())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment