LuciferYang opened a new issue, #13868:
URL: https://github.com/apache/gravitino/issues/13868
### Version
main branch
### Describe what's wrong
`docker stop` or a pod termination never reaches the JVM of the Iceberg REST
server or the Lance REST server, so the container is killed after the grace
period instead of shutting down.
The image entrypoint `start-iceberg-rest-server.sh` ends with `exec
./bin/gravitino-iceberg-rest-server.sh run`, but `run()` in
`bin/gravitino-iceberg-rest-server.sh.template` starts `java` without `exec`.
Bash stays as PID 1, and a bash PID 1 does not act on SIGTERM or forward it, so
the JVM never runs its shutdown hooks.
`bin/gravitino-lance-rest-server.sh.template` has the same `run()`.
`gravitino.sh.template` already uses `exec` here (#11272).
The Helm charts add one more bash layer: the container command is `/bin/bash
/tmp/conf/init.sh`, and the default `initScript` of all three charts
(`gravitino`, `gravitino-iceberg-rest-server`, `gravitino-lance-rest-server`)
starts the entrypoint script without `exec`. So even with `exec` in `run()`, a
pod started from the chart still keeps bash as PID 1.
### Error message and/or stacktrace
`docker stop` waits the full timeout and the container exits with 137
(SIGKILL). The server log ends at `Done, Gravitino Iceberg REST server
started.`, with no shutdown lines.
### How to reproduce
1. `docker run -d --name irc apache/gravitino-iceberg-rest:1.3.1`
2. `docker exec irc ps -eo pid,comm` shows `1 bash`, `java` as its child.
3. `docker stop -t 10 irc` takes 10 seconds, and `docker inspect irc
--format '{{.State.ExitCode}}'` prints 137.
With `exec` added to `run()` in the image, `java` is PID 1, `docker stop`
returns in about 3 seconds with exit code 143, and the log shows `Gravitino
Iceberg REST Server has shut down.`
### Additional context
_No response_
--
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]