Don't request ETA until server has started jobs
authorJens Axboe <axboe@kernel.dk>
Sat, 15 Oct 2011 12:43:41 +0000 (14:43 +0200)
committerJens Axboe <axboe@kernel.dk>
Sat, 15 Oct 2011 12:43:41 +0000 (14:43 +0200)
Otherwise we time out when file layout takes >= 5 seconds.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
client.c
server.c
server.h

index c72f034a429a5b5da2120082d9e9c89d802c5fdb..fb678e177363c7b5a5fb4d1438627dc15653a92e 100644 (file)
--- 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);
index e7a905722f30f4d3b3177aafdbd63c735e7a1376..c1ced42dd351c9e25666cb495fbff7c884ee35cb 100644 (file)
--- 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);
 }
index d709e9826b8eec71b8f6ef45ea8577284ee9d199..da520e3895a5864f5fe079b9fb13bf676e21e19f 100644 (file)
--- 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,