imbajin commented on code in PR #3051:
URL: https://github.com/apache/hugegraph/pull/3051#discussion_r3368529810


##########
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:
   ⚠️ **Forward shutdown to HugeGraphServer**
   
   Evidence: PD and Store now execute their foreground scripts with `-d false`, 
but the server entrypoint still starts `start-hugegraph.sh` in daemon mode and 
then blocks on `tail --pid="$PID" -f /dev/null` at this line. Docker sends 
SIGTERM to PID 1, so this shell/tail path can exit without signaling the Java 
PID; the server then waits for Docker's forced kill instead of a graceful 
shutdown.
   
   Please add a TERM/INT trap that kills and waits for `$PID`, or otherwise run 
the server foreground path after the post-start checks, so `docker stop` shuts 
HugeGraphServer down cleanly.



-- 
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]

Reply via email to