Skip to content

Commit 649e11f

Browse files
authored
[server] Set the waiting time of executing server shutdown hook to 120s to avoid an unclean server shutdown (#2026)
1 parent 4f00709 commit 649e11f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fluss-dist/src/main/resources/bin/fluss-daemon.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ function guaranteed_kill {
8989
kill $to_stop_pid
9090
# if timeout exists, use it
9191
if command -v timeout &> /dev/null ; then
92-
# wait 10 seconds for process to stop. By default, Fluss kills the JVM 5 seconds after sigterm.
93-
timeout 10 tail --pid=$to_stop_pid -f /dev/null &> /dev/null
92+
# wait 120 seconds for process to stop.This timeout shouldn't be set too small; if it is, the server close
93+
# logic within the shutdown hook won't have enough time to complete properly, which would cause the server to
94+
# enter an unclean shutdown state.
95+
timeout 120 tail --pid=$to_stop_pid -f /dev/null &> /dev/null
9496
if [ "$?" -eq 124 ]; then
9597
echo "Daemon $daemon didn't stop within 10 seconds. Killing it."
9698
# send sigkill

0 commit comments

Comments
 (0)