Commit 92a4bfb0 authored by Štěpán Balážik's avatar Štěpán Balážik

don't retry socket binding

parent dd97e184
Pipeline #66133 failed with stage
in 3 minutes and 18 seconds
......@@ -195,19 +195,21 @@ class TestServer:
# A lot of addresses are added to the interface while runnning from Deckard in
# the small amount of time which caused ocassional hiccups while binding to them
# right afterwards in testing. Therefore, we retry a few times.
ex = None
for i in range(self.RETRIES_ON_BIND):
try:
sock.bind(address)
break
except OSError as e:
# Exponential backoff
time.sleep((2 ** i) + random.random())
ex = e
continue
else:
print(ex, address)
raise ex
# ex = None
# for i in range(self.RETRIES_ON_BIND):
# try:
# sock.bind(address)
# break
# except OSError as e:
# # Exponential backoff
# time.sleep((2 ** i) + random.random())
# ex = e
# continue
# else:
# print(ex, address)
# raise ex
sock.bind(address)
if proto == socket.IPPROTO_TCP:
sock.listen(5)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment