This is an automated email from the ASF dual-hosted git repository.
yuqi4733 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 8af70945ae [#7513] fix: server shutdown logic should correctly check
for forceKill (#7559)
8af70945ae is described below
commit 8af70945ae2f9646bafd43b774e8229f959d8d33
Author: Gagan B Mishra <[email protected]>
AuthorDate: Fri Jul 4 03:04:16 2025 -0700
[#7513] fix: server shutdown logic should correctly check for forceKill
(#7559)
### 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)
---
bin/gravitino-iceberg-rest-server.sh.template | 6 +++---
bin/gravitino.sh.template | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/bin/gravitino-iceberg-rest-server.sh.template
b/bin/gravitino-iceberg-rest-server.sh.template
index 61f0080123..7278bae448 100755
--- a/bin/gravitino-iceberg-rest-server.sh.template
+++ b/bin/gravitino-iceberg-rest-server.sh.template
@@ -81,7 +81,7 @@ function wait_for_iceberg_rest_server_to_die() {
break
fi
- $(kill ${pid} > /dev/null 2> /dev/null)
+ kill ${pid} > /dev/null 2> /dev/null
if kill -0 ${pid} > /dev/null 2>&1; then
sleep 3
else
@@ -91,8 +91,8 @@ function wait_for_iceberg_rest_server_to_die() {
currentTime=$(date "+%s")
done
- if [[ forceKill -ne 0 ]]; then
- $(kill -9 ${pid} > /dev/null 2> /dev/null)
+ if [[ $forceKill -ne 0 ]]; then
+ kill -9 ${pid} > /dev/null 2> /dev/null
fi
}
diff --git a/bin/gravitino.sh.template b/bin/gravitino.sh.template
index a19d73d873..e9e7fb637e 100755
--- a/bin/gravitino.sh.template
+++ b/bin/gravitino.sh.template
@@ -81,7 +81,7 @@ function wait_for_gravitino_server_to_die() {
break
fi
- $(kill ${pid} > /dev/null 2> /dev/null)
+ kill ${pid} > /dev/null 2> /dev/null
if kill -0 ${pid} > /dev/null 2>&1; then
sleep 3
else
@@ -91,8 +91,8 @@ function wait_for_gravitino_server_to_die() {
currentTime=$(date "+%s")
done
- if [[ forceKill -ne 0 ]]; then
- $(kill -9 ${pid} > /dev/null 2> /dev/null)
+ if [[ $forceKill -ne 0 ]]; then
+ kill -9 ${pid} > /dev/null 2> /dev/null
fi
}