From c4cbe04cf13cc94ea1c72904f2b63b91fb5c0b84 Mon Sep 17 00:00:00 2001 From: stephenarmstrong Date: Thu, 13 Mar 2014 15:14:32 -0700 Subject: If a broker refuses the connection, try the next --- kafka/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'kafka/client.py') 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") -- cgit v1.2.1