syahra712 commented on issue #138: URL: https://github.com/apache/solr-orbit/issues/138#issuecomment-6425650973
You're right, sorry about that. I only looked for `jmap`/`jcmd` and missed `/usr/bin/jattach` (it's in the `apt-get install` line of the Dockerfile template). I checked it on `solr:9` and it works end to end: - `jattach <pid> dumpheap /var/solr/logs/heap.hprof` runs as the default `solr` user and writes a 55 MB dump in about 0.6 s. - `<pid>` has to be the in-container JVM PID (14 here). PID 1 is `tini`, and `docker inspect .State.Pid` gives the VM-side PID (678), so the `node.pid` we store today can't be used. - After `docker stop` and `docker cp`, the dump arrives on the host together with `solr.log` and the GC log. So for PR 2, the Docker heapdump runs `docker exec <container> jattach <in-container pid> dumpheap /var/solr/logs/heap_at_exit.hprof` before the stop, and the file leaves through the same `docker cp`. The current code also hands a host path to the in-container command, so it would have written to the wrong place anyway. For the local pipelines I'd copy what `bin/solr` already does for thread dumps: use the JDK tool if it's there, otherwise fall back to `jattach`. I'll start on PR 2 with the stop/cp/rm approach. -- 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]
