aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Duraffort <remi.duraffort@linaro.org>2018-07-17 15:16:08 +0200
committerNeil Williams <neil.williams@linaro.org>2018-07-18 07:37:20 +0000
commit7974b5398817911ea4122f393060f4447493eb43 (patch)
tree75cb35d16d6bdbee4509d95ab591fb7171cd0d9c
parent0736d9d135b5228842e80fac59ab8ca92db2fe4d (diff)
slave: allow to kill the process cleanly
When checking the connectivity with the master, lava-slave should still listen for signal to quit if requested. Change-Id: I5e252686a17bfc289fbd4557f2dcfb73d39f54c0
-rwxr-xr-xlava/dispatcher/lava-slave8
1 files changed, 1 insertions, 7 deletions
diff --git a/lava/dispatcher/lava-slave b/lava/dispatcher/lava-slave
index d1ce28084..5498259a6 100755
--- a/lava/dispatcher/lava-slave
+++ b/lava/dispatcher/lava-slave
@@ -594,7 +594,6 @@ def verify_socket(sock, master_url, ipv6=False):
def connect_to_master(poller, pipe_r, sock, master, ipv6):
LOG.info("[BTSP] Greeting the master [%s] => 'HELLO'", master)
- verify_socket(sock, master, ipv6)
send_multipart_u(sock, ["HELLO", str(PROTOCOL_VERSION)])
(leaving, msg) = recv_from_master("[BTSP]", poller, pipe_r, sock)
@@ -607,18 +606,13 @@ def connect_to_master(poller, pipe_r, sock, master, ipv6):
return True
else:
LOG.info("[BTSP] Unexpected message from master: %s", message)
- except socket.gaierror as exc:
- LOG.exception("[BTSP] Socket error: %s", message)
- verify_socket(sock, master, ipv6)
except (IndexError, TypeError):
if msg is not None:
LOG.error("[BTSP] Invalid message from master: %s", msg)
if verify_socket(sock, master, ipv6):
LOG.info("[BTSP] Greeting master => 'HELLO_RETRY' (using the same version?)")
send_multipart_u(sock, ["HELLO_RETRY", str(PROTOCOL_VERSION)])
- (leaving, msg) = recv_from_master("[BTSP]", poller, pipe_r, sock)
- else:
- time.sleep(TIMEOUT)
+ (leaving, msg) = recv_from_master("[BTSP]", poller, pipe_r, sock)
return False