From 47714d68b54de5f9520f8bef520d1451d8eddc04 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 30 Nov 2017 13:27:40 -0700 Subject: [PATCH] client: ignore a client timeout, if the last thing we saw as a trigger If triggers are used and are fatal to the fio backend (killing power, etc), then we don't have time to process the stop/quit commands. We expect the client to go away, but the backend can't let us know. If the last thing we saw was a trigger command, don't exit in error if the client times out and goes away. Signed-off-by: Jens Axboe --- client.c | 7 ++++++- client.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index 11fa262a..54662653 100644 --- a/client.c +++ b/client.c @@ -1666,6 +1666,8 @@ int fio_handle_client(struct fio_client *client) dprint(FD_NET, "client: got cmd op %s from %s (pdu=%u)\n", fio_server_op(cmd->opcode), client->hostname, cmd->pdu_len); + client->last_cmd = cmd->opcode; + switch (cmd->opcode) { case FIO_NET_CMD_QUIT: if (ops->quit) @@ -1940,7 +1942,10 @@ static int fio_check_clients_timed_out(void) else log_err("fio: client %s timed out\n", client->hostname); - client->error = ETIMEDOUT; + if (client->last_cmd != FIO_NET_CMD_VTRIGGER) + client->error = ETIMEDOUT; + else + log_info("fio: ignoring timeout due to vtrigger\n"); remove_client(client); ret = 1; } diff --git a/client.h b/client.h index 394b685d..90082a34 100644 --- a/client.h +++ b/client.h @@ -39,6 +39,7 @@ struct fio_client { int port; int fd; unsigned int refs; + unsigned int last_cmd; char *name; -- 2.25.1