summaryrefslogtreecommitdiff
path: root/kafka/client_async.py
diff options
context:
space:
mode:
Diffstat (limited to 'kafka/client_async.py')
-rw-r--r--kafka/client_async.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/kafka/client_async.py b/kafka/client_async.py
index 190384e..8c61288 100644
--- a/kafka/client_async.py
+++ b/kafka/client_async.py
@@ -131,10 +131,10 @@ class KafkaClient(object):
def _initiate_connect(self, node_id):
"""Initiate a connection to the given node (must be in metadata)"""
- broker = self.cluster.broker_metadata(node_id)
- assert broker, 'Broker id %s not in current metadata' % node_id
-
if node_id not in self._conns:
+ broker = self.cluster.broker_metadata(node_id)
+ assert broker, 'Broker id %s not in current metadata' % node_id
+
log.debug("Initiating connection to node %s at %s:%s",
node_id, broker.host, broker.port)
self._conns[node_id] = BrokerConnection(broker.host, broker.port,