Skip to content

Commit ca6ee61

Browse files
committed
Print JVM thread dumps if the build is cancelled
See gh-39761
1 parent 868629d commit ca6ee61

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/actions/print-jvm-thread-dumps/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ description: Prints a thread dump for all running JVMs
33
runs:
44
using: composite
55
steps:
6-
- run: |
6+
- shell: bash
7+
run: |
78
for java_pid in $(jps -q -J-XX:+PerfDisableSharedMem); do
89
echo "------------------------ pid $java_pid ------------------------"
910
cat /proc/$java_pid/cmdline | xargs -0 echo
1011
jcmd $java_pid Thread.print -l
1112
jcmd $java_pid GC.heap_info
1213
done
13-
exit 0
14-
shell: bash
14+
exit 0

.github/workflows/windows-build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
4545
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
4646
run: ./gradlew build
47+
- name: Print JVM thread dumps when cancelled
48+
uses: ./.github/actions/print-jvm-thread-dumps
49+
if: cancelled()
4750
- name: Send notification
4851
uses: ./.github/actions/send-notification
4952
if: always()

0 commit comments

Comments
 (0)