Skip to content

Commit 8f7a234

Browse files
fix(liveness): execute on worker pool (#1779) (#1780)
(cherry picked from commit 9287edf) Co-authored-by: Andrew Azores <aazores@redhat.com>
1 parent 4bab068 commit 8f7a234

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

src/main/java/io/cryostat/net/web/http/generic/HealthLivenessGetHandler.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ class HealthLivenessGetHandler implements RequestHandler {
3131
@Inject
3232
HealthLivenessGetHandler() {}
3333

34-
@Override
35-
public void handle(RoutingContext ctx) {
36-
ctx.response().setStatusCode(204).end();
37-
}
38-
3934
@Override
4035
public ApiVersion apiVersion() {
4136
return ApiVersion.GENERIC;
@@ -55,4 +50,25 @@ public HttpMethod httpMethod() {
5550
public Set<ResourceAction> resourceActions() {
5651
return ResourceAction.NONE;
5752
}
53+
54+
@Override
55+
public boolean isAsync() {
56+
// This response handler does not actually block, but we force it to execute on the worker
57+
// pool so that the status check reports not only that the event loop dispatch thread is
58+
// alive and responsive, but that the worker pool is also actively servicing requests. If we
59+
// don't force this then this handler only checks if the event loop is alive, but the worker
60+
// pool may be blocked or otherwise unresponsive and the application as a whole will not be
61+
// usable.
62+
return false;
63+
}
64+
65+
@Override
66+
public boolean isOrdered() {
67+
return true;
68+
}
69+
70+
@Override
71+
public void handle(RoutingContext ctx) {
72+
ctx.response().setStatusCode(204).end();
73+
}
5874
}

0 commit comments

Comments
 (0)