From 01be038efc66ea1b49b4471f2ba9dd2d7121cfe7 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sat, 15 Oct 2011 14:43:41 +0200 Subject: [PATCH] Don't request ETA until server has started jobs Otherwise we time out when file layout takes >= 5 seconds. Signed-off-by: Jens Axboe --- client.c | 11 +++++++++-- server.c | 4 ++++ server.h | 5 +++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/client.c b/client.c index c72f034a..fb678e17 100644 --- a/client.c +++ b/client.c @@ -58,8 +58,9 @@ enum { Client_created = 0, Client_connected = 1, Client_started = 2, - Client_stopped = 3, - Client_exited = 4, + Client_running = 3, + Client_stopped = 4, + Client_exited = 5, }; static FLIST_HEAD(client_list); @@ -824,6 +825,10 @@ static int handle_client(struct fio_client *client) handle_probe(client, cmd); free(cmd); break; + case FIO_NET_CMD_RUN: + client->state = Client_running; + free(cmd); + break; case FIO_NET_CMD_START: client->state = Client_started; free(cmd); @@ -861,6 +866,8 @@ static void request_client_etas(void) skipped++; continue; } + if (client->state != Client_running) + continue; assert(!client->eta_in_flight); flist_add_tail(&client->eta_list, &eta_list); diff --git a/server.c b/server.c index e7a90572..c1ced42d 100644 --- a/server.c +++ b/server.c @@ -32,6 +32,7 @@ static int server_fd = -1; static char *fio_server_arg; static char *bind_sock; static struct sockaddr_in saddr_in; +static int first_cmd_check; static const char *fio_server_ops[FIO_NET_CMD_NR] = { "", @@ -48,6 +49,7 @@ static const char *fio_server_ops[FIO_NET_CMD_NR] = { "START", "STOP", "DISK_UTIL", + "RUN", }; const char *fio_server_op(unsigned int op) @@ -539,6 +541,8 @@ static int handle_connection(int sk, int block) void fio_server_idle_loop(void) { + if (!first_cmd_check) + fio_net_send_simple_cmd(server_fd, FIO_NET_CMD_RUN, 0, NULL); if (server_fd != -1) handle_connection(server_fd, 0); } diff --git a/server.h b/server.h index d709e982..da520e38 100644 --- a/server.h +++ b/server.h @@ -35,7 +35,7 @@ struct fio_net_int_cmd { }; enum { - FIO_SERVER_VER = 5, + FIO_SERVER_VER = 6, FIO_SERVER_MAX_PDU = 1024, @@ -52,7 +52,8 @@ enum { FIO_NET_CMD_START = 11, FIO_NET_CMD_STOP = 12, FIO_NET_CMD_DU = 13, - FIO_NET_CMD_NR = 14, + FIO_NET_CMD_RUN = 14, + FIO_NET_CMD_NR = 15, FIO_NET_CMD_F_MORE = 1UL << 0, -- 2.25.1