summaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorSitsofe Wheeler <sitsofe@yahoo.com>2017-08-26 08:38:11 +0100
committerSitsofe Wheeler <sitsofe@yahoo.com>2017-08-26 21:43:35 +0100
commit98413be7fde914374252642b5ece0d81bc02e1c4 (patch)
tree50ba0bdbb2b4296ee9a449ded33c5ac0f4d118c5 /server.c
parentb427f2e12beba7b0c9a655f8ecbd19187c0b6029 (diff)
downloadfio-98413be7fde914374252642b5ece0d81bc02e1c4.tar.gz
fio-98413be7fde914374252642b5ece0d81bc02e1c4.tar.bz2
backend: verify-trigger fixes
Clear the trigger_timeout after we have found it has been exceeded in trigger_timedout() to stop us repeatedly firing the trigger again and again in the future. When --trigger-remote is unset, the server winds up with the remote trigger command represented by buf[] being zero length rather than buf being NULL in handle_trigger_cmd(). Cope with this by returning right away if we find the cmd string is NULL or empty in exec_trigger(). Make server mode fio terminate after sending the verify state back to the client so it goes on behave the same way as standalone fio. This stops the while loop in thread_main() restating and in turn prevents state being cleared away by clear_io_state(). Make keep_running() return false if td->terminate has been set Just In Case. The below would trigger the above problem before this patch: cat <<EOF > trigger.fio [global] ioengine=null time_based=1 runtime=10s size=1M bs=4k rate=4k [trigtest] EOF ./fio --server & ./fio --trigger-timeout=2s --trigger='hostname' --client=localhost \ --debug=net trigger.fio Fixes https://github.com/axboe/fio/issues/431 ("fio intermittently fails to perform IO when --trigger-timeout, --trigger is specified"). Reported-by: saurabhbpl <saurabh.shiva@gmail.com> Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Diffstat (limited to 'server.c')
-rw-r--r--server.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/server.c b/server.c
index a640fe3a..2c08c3e1 100644
--- a/server.c
+++ b/server.c
@@ -970,6 +970,7 @@ static int handle_trigger_cmd(struct fio_net_cmd *cmd)
} else
fio_net_queue_cmd(FIO_NET_CMD_VTRIGGER, rep, sz, NULL, SK_F_FREE | SK_F_INLINE);
+ fio_terminate_threads(TERMINATE_ALL);
exec_trigger(buf);
return 0;
}