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
1 changed files with 7 additions and 5 deletions

View File

@ -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