Skip to content
This repository has been archived by the owner on Nov 28, 2020. It is now read-only.

Commit

Permalink
Tracking child pids of timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
gareth-ellis committed Feb 26, 2016
1 parent e3ed651 commit 2db045c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions experimental/benchmarks/acmeair/run_acmeair.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ function kill_bkg_processes() # kill processes started in background
pkill mongod
JAVA_PID="`ps -ef|grep java|grep -v grep|grep -v slave|awk {'print $2'}`"
kill -9 $JAVA_PID || true

pids=$(ps -eo pid,pgid | awk -v pid=$$ '$2==pid && $1!=pid {print $1}') # get list of all child/grandchild pids
pids=$(ps -eo pid,pgid | awk -v pid=$$ '$2==pid && $1!=pid {print $1}') # get list of all child/grandchild pids - this doesnt seem to work on nodejs benchmark machine....
echo "Killing background processes"
echo $pids
kill -9 $OTHERPID_LIST $pids || true # avoid failing if there is nothing to kill
Expand Down Expand Up @@ -184,7 +183,8 @@ LOOKFORDONE_PID=$!
# start time clock
( sleep $TIMEOUT; echo "TIMEOUT (${TIMEOUT}s)"; echo "fail" >> $DONEFILE_TEMP; ) &
TIMEOUT_PID=$!
OTHERPID_LIST="$OTHERPID_LIST $TIMEOUT_PID $LOOKFORDONE_PID"
TIMEOUT_CHILD=`pgrep -P $TIMEOUT_PID`
export OTHERPID_LIST="$OTHERPID_LIST $TIMEOUT_CHILD $TIMEOUT_PID $LOOKFORDONE_PID"

LOGDIR_PREFIX=$PRODUCT/$DATE/$CUR_DATE
SUMFILE=$LOGDIR_TEMP/$LOGDIR_PREFIX/$SUMLOG
Expand Down Expand Up @@ -260,7 +260,7 @@ PIDS_COMMA=`echo $PIDS|sed 's/ /,/g'`
SERVER_CPU_COMMAND="top -b -d 5 -n 47 -p $PIDS_COMMA"
$SERVER_CPU_COMMAND >> server_cpu.txt &
CPU_PID=$!
OTHERPID_LIST="$OTHERPID_LIST $CPU_PID"
export OTHERPID_LIST="$OTHERPID_LIST $CPU_PID"
while ! grep done $DONEFILE_TEMP &>/dev/null ; do
sleep 3
# Abort the run if an instance fails or if we time out
Expand Down

0 comments on commit 2db045c

Please sign in to comment.