lhotari commented on code in PR #23634:
URL: https://github.com/apache/pulsar/pull/23634#discussion_r1855823709
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/common/configuration/VipStatus.java:
##########
@@ -52,7 +54,15 @@ public String checkStatus() {
if (statusFilePath != null) {
File statusFile = new File(statusFilePath);
if (isReady && statusFile.exists() && statusFile.isFile()) {
- return "OK";
+ // check deadlock
+ String diagnosticResult =
ThreadDumpUtil.buildThreadDiagnosticString();
+ if (StringUtils.isBlank(diagnosticResult)) {
Review Comment:
`ThreadDumpUtil.buildThreadDiagnosticString` will alway return a non-blank
String.
There's an example of detecting a deadlock using JMX API in
https://github.com/apache/pulsar/blob/c9de1bbefd410152c7da6f9e8d5a5d59ab9cbead/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java#L390-L408
.
If we were to add the deadlock check to the status check, it should be
possible to configure the interval for running the check since there's a cost
for running the deadlock check. It should also be possible to disable the
deadlock check completely.
--
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]