mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Increase graceful shutdown timeout
This commit is contained in:
parent
8c7424a191
commit
4558417518
2 changed files with 16 additions and 8 deletions
|
|
@ -101,19 +101,27 @@ function wait_for_zeppelin_to_die() {
|
|||
local pid
|
||||
local count
|
||||
pid=$1
|
||||
timeout=$2
|
||||
count=0
|
||||
while [[ "${count}" -lt 10 ]]; do
|
||||
timeoutTime=$(date "+%s")
|
||||
let "timeoutTime+=$timeout"
|
||||
currentTime=$(date "+%s")
|
||||
forceKill=1
|
||||
|
||||
while [[ $currentTime -lt $timeoutTime ]]; do
|
||||
$(kill ${pid} > /dev/null 2> /dev/null)
|
||||
if kill -0 ${pid} > /dev/null 2>&1; then
|
||||
sleep 3
|
||||
let "count+=1"
|
||||
else
|
||||
forceKill=0
|
||||
break
|
||||
fi
|
||||
if [[ "${count}" == "5" ]]; then
|
||||
currentTime=$(date "+%s")
|
||||
done
|
||||
|
||||
if [[ forceKill -ne 0 ]]; then
|
||||
$(kill -9 ${pid} > /dev/null 2> /dev/null)
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function wait_zeppelin_is_up_for_ci() {
|
||||
|
|
@ -187,7 +195,7 @@ function stop() {
|
|||
if [[ -z "${pid}" ]]; then
|
||||
echo "${ZEPPELIN_NAME} is not running"
|
||||
else
|
||||
wait_for_zeppelin_to_die $pid
|
||||
wait_for_zeppelin_to_die $pid 40
|
||||
$(rm -f ${ZEPPELIN_PID})
|
||||
action_msg "${ZEPPELIN_NAME} stop" "${SET_OK}"
|
||||
fi
|
||||
|
|
@ -200,7 +208,7 @@ function stop() {
|
|||
fi
|
||||
|
||||
pid=$(cat ${f})
|
||||
wait_for_zeppelin_to_die $pid
|
||||
wait_for_zeppelin_to_die $pid 20
|
||||
$(rm -f ${f})
|
||||
done
|
||||
|
||||
|
|
|
|||
|
|
@ -163,10 +163,10 @@ public class RemoteInterpreterProcess implements ExecuteResultHandler {
|
|||
clientPool.clear();
|
||||
clientPool.close();
|
||||
|
||||
// wait for 3 sec and force kill
|
||||
// wait for some time (connectTimeout) and force kill
|
||||
// remote process server.serve() loop is not always finishing gracefully
|
||||
long startTime = System.currentTimeMillis();
|
||||
while (System.currentTimeMillis() - startTime < 3 * 1000) {
|
||||
while (System.currentTimeMillis() - startTime < connectTimeout) {
|
||||
if (this.isRunning()) {
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
|
|
|
|||
Loading…
Reference in a new issue