backend: verify-trigger fixes
authorSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 26 Aug 2017 07:38:11 +0000 (08:38 +0100)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 26 Aug 2017 20:43:35 +0000 (21:43 +0100)
commit98413be7fde914374252642b5ece0d81bc02e1c4
tree50ba0bdbb2b4296ee9a449ded33c5ac0f4d118c5
parentb427f2e12beba7b0c9a655f8ecbd19187c0b6029
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>
backend.c
server.c