Skip to content

[improve][broker] If there is a deadlock in the service, the probe should return a failure because the service may be unavailable #23634

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

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c18aa62
[fix][broker]If there is a deadlock in the service, the probe should …
yyj8 Nov 23, 2024
90ff720
[fix][broker]If there is a deadlock in the service, the probe should …
yyj8 Nov 25, 2024
2b18156
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Nov 26, 2024
70325c0
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Nov 26, 2024
c230aa5
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Nov 26, 2024
2c8819b
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Nov 27, 2024
f17da50
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Nov 27, 2024
dc53040
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Dec 4, 2024
532e69f
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Dec 4, 2024
e1a1dd5
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Dec 4, 2024
69aba3e
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Dec 8, 2024
5970dcc
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Dec 22, 2024
830c01a
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Dec 22, 2024
52ab050
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Dec 24, 2024
5b0c2ec
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Jan 3, 2025
b1eaedd
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Jan 3, 2025
1a2f6aa
Fix checkstyle
lhotari Jan 3, 2025
03e6e02
[improvement][broker] If there is a deadlock in the service, the prob…
yyj8 Feb 15, 2025
2e2ce0b
Merge branch 'master' into check-status-add-deadlock-check
lhotari Mar 18, 2025
afa6980
Merge branch 'master' into check-status-add-deadlock-check
yyj8 Apr 6, 2025
b8da8ad
[improve][broker] If there is a deadlock in the service, the probe sh…
yyj8 Apr 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response.Status;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.pulsar.common.util.ThreadDumpUtil;

/**
* Web resource used by the VIP service to check to availability of the service instance.
Expand All @@ -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)) {
return "OK";
} else {
log.warn("Deadlock detected, service may be unavailable, "
+ "thread stack details are as follows: {}.", diagnosticResult);
throw new WebApplicationException(Status.SERVICE_UNAVAILABLE);
}
}
}
log.warn("Failed to access \"status.html\". The service is not ready");
Expand Down
Loading