summaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2017-11-30 13:28:48 -0700
committerJens Axboe <axboe@kernel.dk>2017-11-30 13:28:48 -0700
commit785a0e210147557902a8cbef9698d7de20aa816a (patch)
treed0db5eeb2c4098b05fdf50370a025d55359c06bc /server.c
parent47714d68b54de5f9520f8bef520d1451d8eddc04 (diff)
server: process connection list before executing trigger
This shrinks the window a bit for allowing the backend to notice that jobs have gone away, and notify the client. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'server.c')
-rw-r--r--server.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/server.c b/server.c
index 967cebe..0323125 100644
--- a/server.c
+++ b/server.c
@@ -616,7 +616,7 @@ static int fio_net_queue_quit(void)
{
dprint(FD_NET, "server: sending quit\n");
- return fio_net_queue_cmd(FIO_NET_CMD_QUIT, NULL, 0, NULL, SK_F_SIMPLE);
+ return fio_net_queue_cmd(FIO_NET_CMD_QUIT, NULL, 0, NULL, SK_F_SIMPLE | SK_F_INLINE);
}
int fio_net_send_quit(int sk)
@@ -636,7 +636,7 @@ static int fio_net_send_ack(struct fio_net_cmd *cmd, int error, int signal)
epdu.error = __cpu_to_le32(error);
epdu.signal = __cpu_to_le32(signal);
- return fio_net_queue_cmd(FIO_NET_CMD_STOP, &epdu, sizeof(epdu), &tag, SK_F_COPY);
+ return fio_net_queue_cmd(FIO_NET_CMD_STOP, &epdu, sizeof(epdu), &tag, SK_F_COPY | SK_F_INLINE);
}
static int fio_net_queue_stop(int error, int signal)
@@ -951,7 +951,7 @@ static int handle_update_job_cmd(struct fio_net_cmd *cmd)
return 0;
}
-static int handle_trigger_cmd(struct fio_net_cmd *cmd)
+static int handle_trigger_cmd(struct fio_net_cmd *cmd, struct flist_head *job_list)
{
struct cmd_vtrigger_pdu *pdu = (struct cmd_vtrigger_pdu *) cmd->payload;
char *buf = (char *) pdu->cmd;
@@ -971,6 +971,7 @@ static int handle_trigger_cmd(struct fio_net_cmd *cmd)
fio_net_queue_cmd(FIO_NET_CMD_VTRIGGER, rep, sz, NULL, SK_F_FREE | SK_F_INLINE);
fio_terminate_threads(TERMINATE_ALL);
+ fio_server_check_jobs(job_list);
exec_trigger(buf);
return 0;
}
@@ -1014,7 +1015,7 @@ static int handle_command(struct sk_out *sk_out, struct flist_head *job_list,
ret = handle_update_job_cmd(cmd);
break;
case FIO_NET_CMD_VTRIGGER:
- ret = handle_trigger_cmd(cmd);
+ ret = handle_trigger_cmd(cmd, job_list);
break;
case FIO_NET_CMD_SENDFILE: {
struct cmd_sendfile_reply *in;