Skip to content

Commit

Permalink
Merge pull request ceph#4794 from XinzeChi/wip-kill-sleep
Browse files Browse the repository at this point in the history
test: check daemon is alive or not agagin when sleep 60s

Reviewed-by: Kefu Chai <[email protected]>
Reviewed-by: Loic Dachary <[email protected]>
  • Loading branch information
Loic Dachary committed May 29, 2015
2 parents 7b4ee40 + 83f88e7 commit a10bd89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test/ceph-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,22 +192,22 @@ function kill_daemons() {
local dir=$1
local signal=${2:-KILL}
local name_prefix=$3 # optional, osd, mon, osd.1
local delays=${4:-0 1 1 1 2 3 5 5 5 10 10 20 60}
local delays=${4:-0 0 1 1 1 2 3 5 5 5 10 10 20 60}

local status=0
for pidfile in $(find $dir | grep $name_prefix'[^/]*\.pid') ; do
pid=$(cat $pidfile)
local send_signal=$signal
local kill_complete=false
for try in $delays ; do
sleep $try
if kill -$send_signal $pid 2> /dev/null ; then
kill_complete=false
else
kill_complete=true
break
fi
send_signal=0
sleep $try
done
if ! $kill_complete ; then
status=1
Expand Down

0 comments on commit a10bd89

Please sign in to comment.