bootstrap node should be last resort in least_loaded_node()

This commit is contained in:
Dana Powers
2016-02-15 21:06:06 -08:00
parent 0d1ccc7485
commit 660b4de232

View File

@@ -440,6 +440,13 @@ class KafkaClient(object):
"""
nodes = list(self._conns.keys())
random.shuffle(nodes)
# If there's a lingering bootstrap node, always try it last
# really we should just kill this connection
if 'bootstrap' in nodes:
nodes.remove('bootstrap')
nodes.append('bootstrap')
inflight = float('inf')
found = None
for node_id in nodes: