summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2017-05-03 08:06:59 -0700
committerGitHub <noreply@github.com>2017-05-03 08:06:59 -0700
commit83617b956d43609c8b8d63489585c3f5837f90ee (patch)
tree4bb4421b18d748a4505eedc0800f3ea816b99dfa
parent384420425c880589679cf08fadcaa94a70b8408b (diff)
downloadkafka-python-83617b956d43609c8b8d63489585c3f5837f90ee.tar.gz
Warn dont raise on DNS lookup failures (#1091)
-rw-r--r--kafka/conn.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/kafka/conn.py b/kafka/conn.py
index 58ce836..12bd08d 100644
--- a/kafka/conn.py
+++ b/kafka/conn.py
@@ -237,11 +237,13 @@ class BrokerConnection(object):
socket.AF_UNSPEC,
socket.SOCK_STREAM)
except socket.gaierror as ex:
- raise socket.gaierror('getaddrinfo failed for {0}:{1}, '
- 'exception was {2}. Is your advertised.listeners (called'
- 'advertised.host.name before Kafka 9) correct and resolvable?'.format(
- self._init_host, self._init_port, ex
- ))
+ log.warning('DNS lookup failed for {0}:{1},'
+ ' exception was {2}. Is your'
+ ' advertised.listeners (called'
+ ' advertised.host.name before Kafka 9)'
+ ' correct and resolvable?'.format(
+ self._init_host, self._init_port, ex))
+ self._gai = []
self._gai_index = 0
else:
# if self._gai already exists, then we should try the next