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

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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new ad4374676b [Cherry-pick to branch-2.0] [#13868] fix(docker): Exec the 
JVM so container stop reaches the REST servers (#13872) (#15097)
ad4374676b is described below

commit ad4374676b9b00d4cf3efeb575c8c3f6a279cc21
Author: Qi Yu <[email protected]>
AuthorDate: Thu Nov 19 17:29:05 2026 +0800

    [Cherry-pick to branch-2.0] [#13868] fix(docker): Exec the JVM so container 
stop reaches the REST servers (#13872) (#15097)
    
    **Cherry-pick Information:**
    - Original commit: 307fd96ebd2fc138761ac2fffaa2624e921cb74a
    - Target branch: `branch-2.0`
    - Status: ✅ Clean cherry-pick (no conflicts)
    - Fork CI: runs in `yuqi1129/gravitino`; re-run it there or push to this
    PR branch
    
    ---------
    
    Co-authored-by: YangJie <[email protected]>
    Co-authored-by: Jerry Shao <[email protected]>
---
 bin/gravitino-iceberg-rest-server.sh.template                      | 2 +-
 bin/gravitino-lance-rest-server.sh.template                        | 2 +-
 dev/charts/gravitino-iceberg-rest-server/tests/configmap_test.yaml | 2 +-
 dev/charts/gravitino-iceberg-rest-server/values.yaml               | 3 ++-
 dev/charts/gravitino-lance-rest-server/tests/configmap_test.yaml   | 2 +-
 dev/charts/gravitino-lance-rest-server/values.yaml                 | 3 ++-
 dev/charts/gravitino/resources/scenarios/pg-values.yaml            | 2 +-
 dev/charts/gravitino/tests/configmap_test.yaml                     | 2 +-
 dev/charts/gravitino/values.yaml                                   | 3 ++-
 9 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/bin/gravitino-iceberg-rest-server.sh.template 
b/bin/gravitino-iceberg-rest-server.sh.template
index f486378528..8c388f1710 100755
--- a/bin/gravitino-iceberg-rest-server.sh.template
+++ b/bin/gravitino-iceberg-rest-server.sh.template
@@ -128,7 +128,7 @@ function start() {
 }
 
 function run() {
-  ${JAVA_RUNNER} ${JAVA_OPTS} ${GRAVITINO_DEBUG_OPTS} -cp 
${GRAVITINO_CLASSPATH} ${GRAVITINO_SERVER_NAME}
+  exec ${JAVA_RUNNER} ${JAVA_OPTS} ${GRAVITINO_DEBUG_OPTS} -cp 
${GRAVITINO_CLASSPATH} ${GRAVITINO_SERVER_NAME}
 }
 
 function stop() {
diff --git a/bin/gravitino-lance-rest-server.sh.template 
b/bin/gravitino-lance-rest-server.sh.template
index b8537873cf..81b6c81717 100644
--- a/bin/gravitino-lance-rest-server.sh.template
+++ b/bin/gravitino-lance-rest-server.sh.template
@@ -128,7 +128,7 @@ function start() {
 }
 
 function run() {
-  ${JAVA_RUNNER} ${JAVA_OPTS} ${GRAVITINO_DEBUG_OPTS} -cp 
${GRAVITINO_CLASSPATH} ${GRAVITINO_SERVER_NAME}
+  exec ${JAVA_RUNNER} ${JAVA_OPTS} ${GRAVITINO_DEBUG_OPTS} -cp 
${GRAVITINO_CLASSPATH} ${GRAVITINO_SERVER_NAME}
 }
 
 function stop() {
diff --git a/dev/charts/gravitino-iceberg-rest-server/tests/configmap_test.yaml 
b/dev/charts/gravitino-iceberg-rest-server/tests/configmap_test.yaml
index 29d819898c..0e419d51e5 100644
--- a/dev/charts/gravitino-iceberg-rest-server/tests/configmap_test.yaml
+++ b/dev/charts/gravitino-iceberg-rest-server/tests/configmap_test.yaml
@@ -46,7 +46,7 @@ tests:
           path: data["hdfs-site.xml"]
       - matchRegex:
           path: data["init.sh"]
-          pattern: "start-iceberg-rest-server\\.sh"
+          pattern: "exec /bin/bash .*/start-iceberg-rest-server\\.sh"
       - matchRegex:
           path: data["gravitino-iceberg-rest-server.conf"]
           pattern: "gravitino\\.iceberg-rest\\.httpPort = 9001"
diff --git a/dev/charts/gravitino-iceberg-rest-server/values.yaml 
b/dev/charts/gravitino-iceberg-rest-server/values.yaml
index 6e71127a93..abf73375f1 100644
--- a/dev/charts/gravitino-iceberg-rest-server/values.yaml
+++ b/dev/charts/gravitino-iceberg-rest-server/values.yaml
@@ -283,11 +283,12 @@ service:
   portName: http
   nodePort: ""
 
+## Keep "exec" on the start command so the JVM runs as PID 1 and receives 
SIGTERM on pod termination.
 initScript: |
   echo "Override config."
   cp /tmp/conf/* ${GRAVITINO_HOME}/conf
   echo "Start the Gravitino Iceberg Rest Catalog Server"
-  /bin/bash ${GRAVITINO_HOME}/bin/start-iceberg-rest-server.sh
+  exec /bin/bash ${GRAVITINO_HOME}/bin/start-iceberg-rest-server.sh
 
 ## Readiness probe for the Gravitino deployment
 ##
diff --git a/dev/charts/gravitino-lance-rest-server/tests/configmap_test.yaml 
b/dev/charts/gravitino-lance-rest-server/tests/configmap_test.yaml
index 031ecdb9d6..4e750e03df 100644
--- a/dev/charts/gravitino-lance-rest-server/tests/configmap_test.yaml
+++ b/dev/charts/gravitino-lance-rest-server/tests/configmap_test.yaml
@@ -50,7 +50,7 @@ tests:
           path: data["gravitino-lance-rest-log4j2.properties"]
       - matchRegex:
           path: data["init.sh"]
-          pattern: "start-lance-rest-server\\.sh"
+          pattern: "exec /bin/bash .*/start-lance-rest-server\\.sh"
       - matchRegex:
           path: data["gravitino-lance-rest-server.conf"]
           pattern: "gravitino\\.lance-rest\\.httpPort = 9101"
diff --git a/dev/charts/gravitino-lance-rest-server/values.yaml 
b/dev/charts/gravitino-lance-rest-server/values.yaml
index 4efdcd16d1..6aad3e8d04 100644
--- a/dev/charts/gravitino-lance-rest-server/values.yaml
+++ b/dev/charts/gravitino-lance-rest-server/values.yaml
@@ -72,11 +72,12 @@ additionalLog4j2Properties:
   appender.console.layout.pattern: "%d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L 
- %m%n"
   rootLogger.appenderRef.console.ref: consoleLogger
 
+## Keep "exec" on the start command so the JVM runs as PID 1 and receives 
SIGTERM on pod termination.
 initScript: |
   echo "Override config."
   cp /tmp/conf/* ${GRAVITINO_HOME}/conf
   echo "Start the Gravitino Lance Rest Server"
-  /bin/bash ${GRAVITINO_HOME}/bin/start-lance-rest-server.sh
+  exec /bin/bash ${GRAVITINO_HOME}/bin/start-lance-rest-server.sh
 
 ## Optional volumes for logs
 volumes:
diff --git a/dev/charts/gravitino/resources/scenarios/pg-values.yaml 
b/dev/charts/gravitino/resources/scenarios/pg-values.yaml
index e188082abf..c243f3564c 100644
--- a/dev/charts/gravitino/resources/scenarios/pg-values.yaml
+++ b/dev/charts/gravitino/resources/scenarios/pg-values.yaml
@@ -22,4 +22,4 @@ postgresql:
 initScript: |
   cp /tmp/conf/* ${GRAVITINO_HOME}/conf
   echo "Start the Gravitino Server"
-  /bin/bash ${GRAVITINO_HOME}/docker/docker-entrypoint.sh
+  exec /bin/bash ${GRAVITINO_HOME}/docker/docker-entrypoint.sh
diff --git a/dev/charts/gravitino/tests/configmap_test.yaml 
b/dev/charts/gravitino/tests/configmap_test.yaml
index ef05708b05..5f12fa3083 100644
--- a/dev/charts/gravitino/tests/configmap_test.yaml
+++ b/dev/charts/gravitino/tests/configmap_test.yaml
@@ -39,7 +39,7 @@ tests:
           path: data["log4j2.properties"]
       - matchRegex:
           path: data["init.sh"]
-          pattern: "docker-entrypoint\\.sh"
+          pattern: "exec /bin/bash .*/docker-entrypoint\\.sh"
       - matchRegex:
           path: data["gravitino.conf"]
           pattern: "gravitino\\.server\\.webserver\\.httpPort = 8090"
diff --git a/dev/charts/gravitino/values.yaml b/dev/charts/gravitino/values.yaml
index f2cfd0f6fe..c4ff025fd8 100644
--- a/dev/charts/gravitino/values.yaml
+++ b/dev/charts/gravitino/values.yaml
@@ -560,10 +560,11 @@ additionalLog4j2Properties:
   appender.console.layout.pattern: "%d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L 
- %m%n"
   rootLogger.appenderRef.console.ref: consoleLogger
 
+## Keep "exec" on the start command so the JVM runs as PID 1 and receives 
SIGTERM on pod termination.
 initScript: |
   cp /tmp/conf/* ${GRAVITINO_HOME}/conf
   echo "Start the Gravitino Server"
-  /bin/bash ${GRAVITINO_HOME}/docker/docker-entrypoint.sh
+  exec /bin/bash ${GRAVITINO_HOME}/docker/docker-entrypoint.sh
 
 ## Expose the gravitino service to be accessed from outside the cluster 
(LoadBalancer service).
 ## or access it from within the cluster (ClusterIP service). Set the service 
type and the port to serve it.

Reply via email to