imbajin commented on code in PR #461: URL: https://github.com/apache/hugegraph-doc/pull/461#discussion_r3380043311
########## content/en/docs/guides/hugegraph-docker-cluster.md: ########## @@ -134,3 +134,28 @@ curl http://localhost:8620/v1/partitions # Partition assignment 4. **Connection refused**: Ensure `HG_*` environment variables use container hostnames (`pd0`, `store0`) instead of `127.0.0.1`. **Viewing runtime logs**: Use `docker logs <container-name>` (e.g. `docker logs hg-pd0`) to view logs directly without exec-ing into the container. + +## Container Supervision & Health Checks + +### Process Supervision Model + +Previously, all three Docker entrypoints ended with `tail -f /dev/null`, which kept the container running even if the Java process crashed. Docker's `restart: unless-stopped` policy never fired because the container never exited. + +The entrypoints now supervise Java directly: + +- **PD and Store containers**: the entrypoint passes `-d false` to the startup script, which `exec`s Java directly. The container process IS the Java process — when Java exits (crash or clean shutdown), the container exits immediately and Docker's restart policy fires. +- **Server container**: the entrypoint uses `tail --pid=$PID -f /dev/null` to block until Java exits. A `SIGTERM`/`SIGINT` trap forwards `docker stop` signals to Java and waits for clean shutdown (exits 0). If Java crashes, the entrypoint exits 1 so the restart policy fires. +- `dumb-init` (PID 1 in all images) forwards signals from Docker to the entrypoint process. + +### Health Check Endpoints + +All four Docker images now include a `HEALTHCHECK` instruction. `docker ps` shows real health status. During the 90-second start period, failed checks do not count. After that, three consecutive failures mark the container as `unhealthy`. Review Comment: ⚠️ Could we scope this to the image tag that actually contains these Docker changes? The quickstart above still uses `HUGEGRAPH_VERSION=1.7.0`, but the supervision / `HEALTHCHECK` behavior documented here comes from apache/hugegraph#3047/#3051/#3052, which landed after the 1.7.0 release. The 1.7.0 Dockerfiles still do not include this behavior, so users following the current command would not see what this section describes. Maybe use `latest` in this guide, or explicitly say this section applies to images built from current master / the next released image tag. Please sync the same scope clarification to the CN page as well. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
