This is an automated email from the ASF dual-hosted git repository.

yuqi4733 pushed a commit to branch branch-0.9
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/branch-0.9 by this push:
     new a8d2eb22e5 [#7513] fix: server shutdown logic should correctly check 
for forceKill (#7573)
a8d2eb22e5 is described below

commit a8d2eb22e57964cb0f8a09d8bf47c2387b6c6a1b
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jul 4 19:06:59 2025 +0800

    [#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]>
---
 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
 }
 

Reply via email to