summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar <omar.ghishan@rd.io>2014-03-13 18:18:58 -0700
committerOmar <omar.ghishan@rd.io>2014-03-13 18:18:58 -0700
commit32edabdaaff6746e4926cc897b4bba917a80cb54 (patch)
tree0e67e46fc15fa9d5564ae1d9521611adec93dc40
parent09c053a1be858c383019c3ac63839d5bc249f622 (diff)
parentc4cbe04cf13cc94ea1c72904f2b63b91fb5c0b84 (diff)
downloadkafka-python-32edabdaaff6746e4926cc897b4bba917a80cb54.tar.gz
Merge pull request #141 from stephenarmstrong/fully-handle-broker-lists
If a broker refuses the connection, try the next
-rw-r--r--kafka/client.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/kafka/client.py b/kafka/client.py
index 96cc1df..a683fe0 100644
--- a/kafka/client.py
+++ b/kafka/client.py
@@ -83,14 +83,14 @@ class KafkaClient(object):
brokers. Keep trying until you succeed.
"""
for (host, port) in self.hosts:
- conn = self._get_conn(host, port)
try:
+ conn = self._get_conn(host, port)
conn.send(requestId, request)
response = conn.recv(requestId)
return response
except Exception, e:
- log.warning("Could not send request [%r] to server %s, "
- "trying next server: %s" % (request, conn, e))
+ log.warning("Could not send request [%r] to server %s:%i, "
+ "trying next server: %s" % (request, host, port, e))
continue
raise KafkaUnavailableError("All servers failed to process request")