Skip to content

Commit

Permalink
fix(liveness): execute on worker pool (cryostatio#1779)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Nov 17, 2023
1 parent 32a262f commit 9287edf
Showing 1 changed file with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ class HealthLivenessGetHandler implements RequestHandler {
@Inject
HealthLivenessGetHandler() {}

@Override
public void handle(RoutingContext ctx) {
ctx.response().setStatusCode(204).end();
}

@Override
public ApiVersion apiVersion() {
return ApiVersion.GENERIC;
Expand All @@ -55,4 +50,25 @@ public HttpMethod httpMethod() {
public Set<ResourceAction> resourceActions() {
return ResourceAction.NONE;
}

@Override
public boolean isAsync() {
// This response handler does not actually block, but we force it to execute on the worker
// pool so that the status check reports not only that the event loop dispatch thread is
// alive and responsive, but that the worker pool is also actively servicing requests. If we
// don't force this then this handler only checks if the event loop is alive, but the worker
// pool may be blocked or otherwise unresponsive and the application as a whole will not be
// usable.
return false;
}

@Override
public boolean isOrdered() {
return true;
}

@Override
public void handle(RoutingContext ctx) {
ctx.response().setStatusCode(204).end();
}
}

0 comments on commit 9287edf

Please sign in to comment.