This is an automated email from the ASF dual-hosted git repository.
roryqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/master by this push:
new 351275d [ISSUE-111] Sleep less time but try more times when stopping
(#112)
351275d is described below
commit 351275d532bdf61e12bd4efd3f8f8a68b091c67d
Author: xianjingfeng <[email protected]>
AuthorDate: Sat Jul 30 18:02:55 2022 +0800
[ISSUE-111] Sleep less time but try more times when stopping (#112)
### What changes were proposed in this pull request?
Solve issue #111, Sleep less time but try more times when stopping
### Why are the changes needed?
Waiting time for executing stop script is too long even if the JVM exits
early.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Have already verify in our production enviroment.
---
bin/utils.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bin/utils.sh b/bin/utils.sh
index a8b826d..77b1b87 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"