bitflicker64 commented on code in PR #3051:
URL: https://github.com/apache/hugegraph/pull/3051#discussion_r3368833553
##########
hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:
##########
@@ -91,4 +91,8 @@ if [[ "${ACTUAL_BACKEND}" == "hstore" ]]; then
./bin/wait-partition.sh || log "WARN: partitions not assigned yet"
fi
-tail -f /dev/null
+PID=$(cat ./bin/pid 2>/dev/null || true)
+if [[ -n "$PID" ]]; then
+ tail --pid="$PID" -f /dev/null
Review Comment:
Good catch added a `TERM/INT` trap before the `tail --pid` block in f20b8a4:
```bash
PID=$(cat ./bin/pid 2>/dev/null || true)
if [[ -n "$PID" ]]; then
trap 'kill -TERM "$PID" 2>/dev/null; while kill -0 "$PID" 2>/dev/null;
do sleep 1; done; exit 0' TERM INT
tail --pid="$PID" -f /dev/null
exit 1
fi
```
When `dumb-init` forwards SIGTERM from `docker stop`, the trap fires: sends
SIGTERM to Java, polls with `kill -0` until Java exits cleanly, then exits 0.
The `tail --pid` crash-detection path still exits 1 so restart policy fires on
a crash.
--
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]