bitflicker64 opened a new pull request, #3051:
URL: https://github.com/apache/hugegraph/pull/3051

   ## Purpose of the PR
   
   - relates to #3043
   
   All three `docker-entrypoint.sh` files used `tail -f /dev/null` to keep the 
container alive. When Java crashed, `tail` kept running and the container 
stayed up with no Java inside — Docker restart policy never fired.
   
   ## Main Changes
   
   **PD and Store:** replace daemon start + `tail -f /dev/null` with `-d 
false`, which triggers the foreground branch added in #3047. `exec java` 
replaces the shell with Java directly, so the entrypoint blocks and exits with 
Java's real exit code when Java exits.
   
   **Server:** keep daemon start (`wait-partition.sh` must run after Java is 
already up in the background). Replace `tail -f /dev/null` with `tail 
--pid=$(cat ./bin/pid) -f /dev/null`. When Java exits, `tail --pid` returns, 
entrypoint exits 1, restart policy fires.
   
   Note: server entrypoint always exits 1 — `start-hugegraph.sh` calls `disown` 
before returning so Java is not a child of the entrypoint shell and its real 
exit code is not available. This is sufficient for `--restart=on-failure`.
   
   | Component | Before | After |
   |---|---|---|
   | PD | daemon start + `tail -f /dev/null` | `-d false` → `exec java` blocks |
   | Store | daemon start + `tail -f /dev/null` | `-d false` → `exec java` 
blocks |
   | Server | daemon start + `tail -f /dev/null` | daemon start + `tail --pid` 
supervision |
   
   ## Verifying these changes
   
   - [x] Need tests and can be verified as follows:
     - `docker run --restart=on-failure` → `kill -9` Java inside container → 
container exits and Docker restarts it automatically
     - Verified locally: 3 kill-9 tests on server container, PD restart loop 
confirmed
   
   ## Does this PR potentially affect the following parts?
   
   - [ ] Dependencies
   - [ ] Modify configurations
   - [ ] The public API
   - [ ] Other affects
   - [x] Nope
   
   ## Documentation Status
   
   - [x] `Doc - TODO` — README/docs update for Docker deployment lifecycle will 
follow in a separate PR


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