Skip to content

Commit a8d2eb2

Browse files
[#7513] fix: server shutdown logic should correctly check for forceKill (#7573)
### What changes were proposed in this pull request? server shutdown logic should correctly check for forceKill The if statement should check for forcekill variable value. Earlier, it was doing a comparison against the string `forcekill` which would always evaluate to true. ### Why are the changes needed? Required for correct shutdown of the service Fix: #7513 ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? ``` ./bin/gravitino.sh start ./bin/gravitino.sh stop ``` (also modified the script to echo some more logs while shutting down. not committed in the patch, done only for local testing) Co-authored-by: Gagan B Mishra <[email protected]>
1 parent a9d0d1d commit a8d2eb2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bin/gravitino-iceberg-rest-server.sh.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function wait_for_iceberg_rest_server_to_die() {
8181
break
8282
fi
8383

84-
$(kill ${pid} > /dev/null 2> /dev/null)
84+
kill ${pid} > /dev/null 2> /dev/null
8585
if kill -0 ${pid} > /dev/null 2>&1; then
8686
sleep 3
8787
else
@@ -91,8 +91,8 @@ function wait_for_iceberg_rest_server_to_die() {
9191
currentTime=$(date "+%s")
9292
done
9393

94-
if [[ forceKill -ne 0 ]]; then
95-
$(kill -9 ${pid} > /dev/null 2> /dev/null)
94+
if [[ $forceKill -ne 0 ]]; then
95+
kill -9 ${pid} > /dev/null 2> /dev/null
9696
fi
9797
}
9898

bin/gravitino.sh.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function wait_for_gravitino_server_to_die() {
8181
break
8282
fi
8383

84-
$(kill ${pid} > /dev/null 2> /dev/null)
84+
kill ${pid} > /dev/null 2> /dev/null
8585
if kill -0 ${pid} > /dev/null 2>&1; then
8686
sleep 3
8787
else
@@ -91,8 +91,8 @@ function wait_for_gravitino_server_to_die() {
9191
currentTime=$(date "+%s")
9292
done
9393

94-
if [[ forceKill -ne 0 ]]; then
95-
$(kill -9 ${pid} > /dev/null 2> /dev/null)
94+
if [[ $forceKill -ne 0 ]]; then
95+
kill -9 ${pid} > /dev/null 2> /dev/null
9696
fi
9797
}
9898

0 commit comments

Comments
 (0)