From 6b920d0881c701a27a590185f3726177f23db961 Mon Sep 17 00:00:00 2001 From: xianjingfeng <583872483@qq.com> Date: Sat, 30 Jul 2022 17:39:44 +0800 Subject: [PATCH] Sleep less time but try more times when stopping --- bin/utils.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/utils.sh b/bin/utils.sh index a8b826d127..77b1b874d6 100644 --- a/bin/utils.sh +++ b/bin/utils.sh @@ -40,7 +40,7 @@ function is_process_running { function common_shutdown { process_name="$1" install_dir="$2" - max_attempt=3 + max_attempt=30 pid=`cat ${install_dir}/currentpid` kill_process_with_retry "${pid}" "${process_name}" "${max_attempt}" @@ -63,7 +63,7 @@ function kill_process_with_retry { local pid="$1" local pname="$2" local maxattempt="$3" - local sleeptime=30 + local sleeptime=3 if ! is_process_running $pid ; then echo "ERROR: process name ${pname} with pid: ${pid} not found" @@ -75,7 +75,7 @@ function kill_process_with_retry { if is_process_running $pid; then kill ${pid} fi - sleep 30 + sleep $sleeptime if is_process_running $pid; then echo "$pname is not dead [pid: $pid]" echo "sleeping for $sleeptime seconds before retry"