Create thread dumps for all running JVMs when the build gets cancelled#13100
Create thread dumps for all running JVMs when the build gets cancelled#13100normanmaurer merged 3 commits intonetty:4.1from
Conversation
|
@lhotari nice... do you also have a solution for windows / macOs ? |
@normanmaurer I'll work on that. I also noticed that quite a few builds run the JVM within docker. I'll work on a solution that uses https://github.com/apangin/jattach for triggering the thread dumps since that tool works also for Java processes that run inside docker containers. |
|
@normanmaurer I have made changes to support java processes in docker containers as well as support for windows / macos. Here's an example of the thread dump of a process running in a docker container: https://github.com/lhotari/netty/actions/runs/3872145028/jobs/6600659632#step:9:432 This example is from a windows container: A small detail on windows is that the maven process gets killed when the GitHub Actions job gets cancelled and there will be no thread dump for the main maven process itself. On Linux, the maven main process isn't killed immediately and there will also be a thread dump available for that process. The thread dump for the surefire process will be available also on windows as seen in the above example. |
|
@lhotari thanks so much! This is amazing |
#13100) Motivation: When a GitHub Actions build job gets cancelled because of a timeout, it would be useful to have a thread dump for all running JVM processes so that it would be able to find the reason why the build job timed out. Modification: Add an inline composite action that uses bash, jps and jcmd to create thread dumps for all running Java processes. This is referenced in ci-pr.yml workflow's verify-pr job and gets run when the build job is cancelled. This is an example of a thread dump that gets created: https://github.com/lhotari/netty/pull/1/checks#step:7:28 . Result: Easier to debug builds that did timeout.
Motivation:
When a GitHub Actions build job gets cancelled because of a timeout, it would be useful to have a thread dump for all running JVM processes so that it would be able to find the reason why the build job timed out.
Modification:
Add an inline composite action that uses bash, jps and jcmd to create thread dumps for all running Java processes.
This is referenced in ci-pr.yml workflow's verify-pr job and gets run when the build job is cancelled.
This is an example of a thread dump that gets created: https://github.com/lhotari/netty/pull/1/checks#step:7:28 .