client: ignore SEND_ETA, if we can't fin a reply command
authorJens Axboe <axboe@fb.com>
Tue, 13 Sep 2016 15:08:00 +0000 (09:08 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 13 Sep 2016 15:08:00 +0000 (09:08 -0600)
This can happen if we time out a reply, but the the reply comes
in a bit later. For that case, we already decremented the ETA
count, so we should just ignore the late reply.

Signed-off-by: Jens Axboe <axboe@fb.com>
client.c

index 3456665009b8fb9fc65ad98c7235431774809820..c8069a0159acb64929be53c75974698d78d5047e 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1183,7 +1183,7 @@ void fio_client_sum_jobs_eta(struct jobs_eta *dst, struct jobs_eta *je)
        strcpy((char *) dst->run_str, (char *) je->run_str);
 }
 
-static void remove_reply_cmd(struct fio_client *client, struct fio_net_cmd *cmd)
+static bool remove_reply_cmd(struct fio_client *client, struct fio_net_cmd *cmd)
 {
        struct fio_net_cmd_reply *reply = NULL;
        struct flist_head *entry;
@@ -1199,12 +1199,13 @@ static void remove_reply_cmd(struct fio_client *client, struct fio_net_cmd *cmd)
 
        if (!reply) {
                log_err("fio: client: unable to find matching tag (%llx)\n", (unsigned long long) cmd->tag);
-               return;
+               return false;
        }
 
        flist_del(&reply->list);
        cmd->tag = reply->saved_tag;
        free(reply);
+       return true;
 }
 
 int fio_client_wait_for_reply(struct fio_client *client, uint64_t tag)
@@ -1653,7 +1654,8 @@ int fio_handle_client(struct fio_client *client)
        case FIO_NET_CMD_ETA: {
                struct jobs_eta *je = (struct jobs_eta *) cmd->payload;
 
-               remove_reply_cmd(client, cmd);
+               if (!remove_reply_cmd(client, cmd))
+                       break;
                convert_jobs_eta(je);
                handle_eta(client, cmd);
                break;