pallavithegod commented on code in PR #3360:
URL: https://github.com/apache/hugegraph/pull/3360#discussion_r4306710284
##########
hugegraph-server/hugegraph-dist/src/assembly/static/bin/util.sh:
##########
@@ -16,6 +16,51 @@
# limitations under the License.
#
+function record_jvm_startup_diagnostics() {
+ JVM_STARTUP_TIME=$(date -u +'%Y-%m-%d %H:%M:%S.%N UTC')
+ JVM_STARTUP_LOG_OFFSET=$(stat -c %s ./logs/hugegraph-server.log
2>/dev/null || echo 0)
+}
+
+function print_jvm_thread_hint() {
+ local kind
+ kind=$(awk '
+ /pthread_create.*\(EPERM\)|pthread_create.*Operation not permitted/ {
denied = 1 }
+ /[Tt]hread.*Operation not permitted/ { denied = 1 }
+ /Cannot create worker GC thread/ { resources = 1 }
+ END { if (denied) print "denied"; else if (resources) print
"resources" }
+ ')
+ case "$kind" in
+ denied)
+ echo 'ERROR: JVM thread creation was denied (EPERM). Check the
Docker host seccomp profile and security policy.' >&2
+ echo 'To diagnose seccomp restrictions, retry with --security-opt
seccomp=unconfined; use a compatible host/runtime profile for normal
operation.' >&2
+ ;;
+ resources)
+ echo 'ERROR: JVM could not create a GC worker thread. Possible
causes include seccomp denial, insufficient memory, or process/thread limits.'
>&2
+ echo 'Look for pthread_create failed (EPERM) above in the
container log; if present, check the host seccomp profile and security policy.'
>&2
Review Comment:
Fixed in ae3e701cc. Startup records the stdout-file offset and scans its new
bytes before generic crash headers; the fallback hint also names that file.
Added STDOUT_MODE=false cases with and without a crash file, stale stdout, and
a truncated stdout file. The complete entrypoint fixture, focused Maven tests,
clean compilation, RAT, and repository Checkstyle pass.
--
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]