Skip to content

Commit 149d7ab

Browse files
committed
Fix conficts related to error message
1 parent 6447fdb commit 149d7ab

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

kafka/conn.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,13 @@ def connect(self):
233233
socket.AF_UNSPEC,
234234
socket.SOCK_STREAM)
235235
except socket.gaierror as ex:
236-
raise socket.gaierror('getaddrinfo failed for {0}:{1}, '
237-
'exception was {2}. Is your advertised.host.name correct'
238-
' and resolvable?'.format(
239-
self.host, self.port, ex
240-
))
236+
log.warning('DNS lookup failed for {0}:{1},'
237+
' exception was {2}. Is your'
238+
' advertised.listeners (called'
239+
' advertised.host.name before Kafka 9)'
240+
' correct and resolvable?'.format(
241+
self.host, self.port, ex))
242+
self._gai = []
241243
self._gai_index = 0
242244
else:
243245
# if self._gai already exists, then we should try the next

0 commit comments

Comments
 (0)