Print JVM thread dumps if the build is cancelled

See gh-39761
This commit is contained in:
Andy Wilkinson
2024-02-28 10:17:57 +00:00
parent 868629d9c7
commit ca6ee61493
2 changed files with 6 additions and 3 deletions

View File

@@ -3,12 +3,12 @@ description: Prints a thread dump for all running JVMs
runs:
using: composite
steps:
- run: |
- shell: bash
run: |
for java_pid in $(jps -q -J-XX:+PerfDisableSharedMem); do
echo "------------------------ pid $java_pid ------------------------"
cat /proc/$java_pid/cmdline | xargs -0 echo
jcmd $java_pid Thread.print -l
jcmd $java_pid GC.heap_info
done
exit 0
shell: bash
exit 0