From 660b4de23204f51fbfd16421f7d02404f386bb83 Mon Sep 17 00:00:00 2001 From: Dana Powers Date: Mon, 15 Feb 2016 21:06:06 -0800 Subject: bootstrap node should be last resort in least_loaded_node() --- kafka/client_async.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'kafka/client_async.py') diff --git a/kafka/client_async.py b/kafka/client_async.py index 0f4863a..f048be9 100644 --- a/kafka/client_async.py +++ b/kafka/client_async.py @@ -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: -- cgit v1.2.1