imbajin commented on code in PR #3187:
URL: https://github.com/apache/hugegraph/pull/3187#discussion_r3919676942
##########
hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:
##########
@@ -98,6 +98,19 @@ if [[ -n "${HG_SERVER_AUTH_TOKEN_SECRET:-}" ]]; then
fi
fi
+# How long the entrypoint lets the server take to answer on its REST port
+# before it gives up and ends the container. An orchestrator that already
+# owns this budget through a startup probe needs to raise it, otherwise the
+# container terminates a JVM that is still starting and the probe never gets
+# to decide. Validated here so a typo fails before init-store runs, rather
+# than reaching the arithmetic in wait_for_startup.
+SERVER_STARTUP_TIMEOUT_S="${HG_SERVER_STARTUP_TIMEOUT_S:-120}"
+if [[ ! "${SERVER_STARTUP_TIMEOUT_S}" =~ ^[1-9][0-9]*$ ]]; then
Review Comment:
⚠️ `HG_SERVER_STARTUP_TIMEOUT_S` accepts any positive integer, but
`wait_for_startup` computes `stop_s=$((now_s + timeout_s))` (the shared
`util.sh` implementation). With the documented input `9223372036854775807`,
Bash overflows that sum to a negative value, so the loop is skipped and the
container reports a startup timeout immediately instead of honoring the
configured budget. Please reject values that cannot be safely added to the
current epoch or use overflow-safe/saturating deadline arithmetic, and add a
boundary test.
--
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]