LuciferYang opened a new pull request, #13872:
URL: https://github.com/apache/gravitino/pull/13872

   ### What changes were proposed in this pull request?
   
   - `run()` in `bin/gravitino-iceberg-rest-server.sh.template` and 
`bin/gravitino-lance-rest-server.sh.template` now starts the JVM with `exec`, 
as `gravitino.sh.template` already does.
   - The default `initScript` of the `gravitino`, 
`gravitino-iceberg-rest-server` and `gravitino-lance-rest-server` charts (and 
the `pg-values.yaml` scenario) now `exec`s the entrypoint script.
   
   With both, the JVM is PID 1 in the container and receives the SIGTERM sent 
by `docker stop` or the kubelet.
   
   ### Why are the changes needed?
   
   Without `exec`, bash stays as PID 1. A bash PID 1 neither acts on SIGTERM 
nor forwards it, so the JVM never runs its shutdown hooks and is killed with 
SIGKILL once the grace period ends. In-flight requests are cut off and every 
stop waits the full timeout.
   
   Fix: #13868
   
   ### Does this PR introduce _any_ user-facing change?
   
   `docker stop` and pod termination now shut the servers down instead of 
killing them after the grace period. Users who override `initScript` in their 
chart values need to add `exec` themselves to get the same behavior.
   
   ### How was this patch tested?
   
   - The chart tests in `configmap_test.yaml` of the three charts now require 
`exec /bin/bash` before the start script.
   - Manual check with the `apache/gravitino-iceberg-rest:1.3.1` image, 
starting it both directly and through a chart-style `init.sh`: without `exec`, 
`docker stop -t 10` takes 10 seconds and the container exits with 137 with no 
shutdown log. With `exec` in `run()` and in `init.sh`, `java` is PID 1, the 
stop takes about 3 seconds, the exit code is 143, and the log ends with 
`Gravitino Iceberg REST Server has shut down.`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to