Unset finger client timeout after connect

Our finger client will timeout after 10 seconds if no data is
received from the executor after we connect. We really only
want the timeout on the connection portion and just wait forever
until some data starts streaming back. Unset the socket timeout
after connecting.

Change-Id: I94398f78ac6e36715eed830c70ef2b178b310a34
This commit is contained in:
David Shrewsbury 2018-02-21 13:41:28 -05:00
parent 885e1423ca
commit 40d1204c2a
1 changed files with 2 additions and 0 deletions

View File

@ -49,6 +49,8 @@ class RequestHandler(streamer_utils.BaseFingerRequestHandler):
Both IPv4 and IPv6 are supported.
'''
with socket.create_connection((server, port), timeout=10) as s:
# timeout only on the connection, let recv() wait forever
s.settimeout(None)
msg = "%s\n" % build_uuid # Must have a trailing newline!
s.sendall(msg.encode('utf-8'))
while True: