2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-21 23:23:40 +00:00

Fix SLP hangs on bad targets

Have SLP timeout if there are endpoints that can half-hang
a connection.
This commit is contained in:
Jarrod Johnson 2019-04-03 08:34:42 -04:00
parent 835d1fc0ab
commit 7232a0c1b3

View File

@ -335,6 +335,7 @@ def _add_attributes(parsed):
else:
net = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
net.settimeout(1.0)
net.connect(target)
except socket.error:
return
@ -363,6 +364,7 @@ def query_srvtypes(target):
while tries and not connected:
tries -= 1
try:
net.settimeout(1.0)
net.connect(target)
connected = True
except socket.error: