Warn dont raise on DNS lookup failures

This commit is contained in:
Dana Powers
2017-04-29 10:15:32 -07:00
parent 120410bcb4
commit e31c18a968

View File

@@ -237,11 +237,13 @@ class BrokerConnection(object):
socket.AF_UNSPEC, socket.AF_UNSPEC,
socket.SOCK_STREAM) socket.SOCK_STREAM)
except socket.gaierror as ex: except socket.gaierror as ex:
raise socket.gaierror('getaddrinfo failed for {0}:{1}, ' log.warning('DNS lookup failed for {0}:{1},'
'exception was {2}. Is your advertised.listeners (called' ' exception was {2}. Is your'
'advertised.host.name before Kafka 9) correct and resolvable?'.format( ' advertised.listeners (called'
self._init_host, self._init_port, ex ' advertised.host.name before Kafka 9)'
)) ' correct and resolvable?'.format(
self._init_host, self._init_port, ex))
self._gai = []
self._gai_index = 0 self._gai_index = 0
else: else:
# if self._gai already exists, then we should try the next # if self._gai already exists, then we should try the next