-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New liveness probe to check for deadlocked threads #11388
base: 4.8.x
Are you sure you want to change the base?
New liveness probe to check for deadlocked threads #11388
Conversation
This is an example for the details of a deadlock: {
"name": "example-app",
"status": "DOWN",
"details": {
"deadlockedThreads": {
"name": "example-app",
"status": "DOWN",
"details": [
{
"threadId": "60",
"threadName": "Thread-0",
"threadState": "BLOCKED",
"daemon": "false",
"priority": "5",
"suspended": "false",
"inNative": "false",
"lockName": "java.lang.Object@7d10b1ca",
"lockOwnerName": "Thread-1",
"lockOwnerId": "61",
"lockedSynchronizers": [],
"stackTrace": "app//com.example.Deadlock.lambda$new$0(Deadlock.java:27)\n- blocked on java.lang.Object@7d10b1ca\n- locked java.lang.Object@4505ea74\napp//com.example.Deadlock$$Lambda/0x000001906948b360.run(Unknown Source)\njava.base@21/java.lang.Thread.runWith(Thread.java:1596)\njava.base@21/java.lang.Thread.run(Thread.java:1583)\n"
},
{
"threadId": "61",
"threadName": "Thread-1",
"threadState": "BLOCKED",
"daemon": "false",
"priority": "5",
"suspended": "false",
"inNative": "false",
"lockName": "java.lang.Object@4505ea74",
"lockOwnerName": "Thread-0",
"lockOwnerId": "60",
"lockedSynchronizers": [],
"stackTrace": "app//com.example.Deadlock.lambda$new$1(Deadlock.java:43)\n- blocked on java.lang.Object@4505ea74\n- locked java.lang.Object@7d10b1ca\napp//com.example.Deadlock$$Lambda/0x000001906948b580.run(Unknown Source)\njava.base@21/java.lang.Thread.runWith(Thread.java:1596)\njava.base@21/java.lang.Thread.run(Thread.java:1583)\n"
}
]
}
}
} |
9c3c995
to
5e6a158
Compare
thanks can you target the 4.8.x branch? |
5e6a158
to
51b2b7e
Compare
51b2b7e
to
905204e
Compare
I have rebased onto the 4.8.x branch. |
I will add some documentation to healthEndpoint.adoc tomorrow. |
0eb3cac
to
efc9a60
Compare
I have adapted the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abrenk Thanks for your contribution. I have added a functional test.
Seems it is failing the native tests, not sure if this API for this is different with Native Image |
I have used official Graal SDK However, @yawkat pointed me to Jackson Databind's @graemerocher what do you think? |
This is a new liveness probe that uses the
ThreadMXBean
to check for deadlocked threads.It is currently enabled by default like the other probes in this module, as long as
endpoints.health.deadlocked-threads.enabled
is not set tofalse
. There is no other configuration.As one would expect the health status is set to DOWN if any deadlocked threads are found and their
ThreadInfo
including a formatted stacktrace are given in the details.