Don't request ETA until server has started jobs
Otherwise we time out when file layout takes >= 5 seconds.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/client.c b/client.c
index c72f034..fb678e1 100644
--- a/client.c
+++ b/client.c
@@ -58,8 +58,9 @@
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 @@
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 @@
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 e7a9057..c1ced42 100644
--- a/server.c
+++ b/server.c
@@ -32,6 +32,7 @@
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 @@
"START",
"STOP",
"DISK_UTIL",
+ "RUN",
};
const char *fio_server_op(unsigned int op)
@@ -539,6 +541,8 @@
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 d709e98..da520e3 100644
--- a/server.h
+++ b/server.h
@@ -35,7 +35,7 @@
};
enum {
- FIO_SERVER_VER = 5,
+ FIO_SERVER_VER = 6,
FIO_SERVER_MAX_PDU = 1024,
@@ -52,7 +52,8 @@
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,