Gently prod children with a SIGQUIT on terminate
authorJens Axboe <jens.axboe@oracle.com>
Mon, 5 Mar 2007 11:32:32 +0000 (12:32 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 5 Mar 2007 11:32:32 +0000 (12:32 +0100)
This should unstuck most loops.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c

diff --git a/fio.c b/fio.c
index b668d85..d426ad6 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -67,6 +67,7 @@ static void terminate_threads(int group_id, int forced_kill)
 
        for_each_td(td, i) {
                if (group_id == TERMINATE_ALL || groupid == td->groupid) {
+                       kill(td->pid, SIGQUIT);
                        td->terminate = 1;
                        td->start_delay = 0;
                        if (forced_kill)
@@ -893,7 +894,8 @@ static void reap_threads(int *nr_running, int *t_rate, int *m_rate)
                        if (WIFSIGNALED(status)) {
                                int sig = WTERMSIG(status);
 
-                               log_err("fio: pid=%d, got signal=%d\n", td->pid, sig);
+                               if (sig != SIGQUIT)
+                                       log_err("fio: pid=%d, got signal=%d\n", td->pid, sig);
                                td_set_runstate(td, TD_REAPED);
                                goto reaped;
                        }