Skip to content

Commit

Permalink
kill the MultiReader java process
Browse files Browse the repository at this point in the history
  • Loading branch information
xieliang committed Jan 11, 2017
1 parent d6ce42c commit 16c15bd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/integration/smoketest.sh
Expand Up @@ -97,23 +97,29 @@ nohup ${DLOG_ROOT}/distributedlog-tutorials/distributedlog-basic/bin/runner run
echo $! > ${LOG_DIR}/writer.pid

# wait for 20 seconds
echo "sleep 20"
sleep 20

# kill the writer
echo "kill the writer"
if [ -f ${LOG_DIR}/writer.pid ]; then
writerpid=$(cat ${LOG_DIR}/writer.pid)
if kill -0 $writerpid > /dev/null 2>&1; then
echo "kill $writerpid"
kill $writerpid
fi
fi

# stop the reader
# kill the reader
echo "kill the reader"
if [ -f ${LOG_DIR}/reader.pid ]; then
readerpid=$(cat ${LOG_DIR}/reader.pid)
if kill -0 $readerpid > /dev/null 2>&1; then
echo "kill $readerpid"
kill $readerpid
fi
fi
ps ax | grep MultiReader | grep java | grep -v grep | awk '{print $1}' | xargs kill -9

# check the number of records received
NUM_RECORDS=`cat ${LOG_DIR}/reader.out | grep "record-" | wc -l`
Expand All @@ -126,7 +132,7 @@ if [ $NUM_RECORDS -lt 18 ]; then
exit 1
fi

# stop a write proxy
# stop the write proxy
echo "stop the write proxy"
${DLOG_ROOT}/distributedlog-service/bin/dlog-daemon.sh stop writeproxy

Expand Down

0 comments on commit 16c15bd

Please sign in to comment.