Skip to content
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

fix(liveness): execute on worker pool #1779

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Changes from all commits
Commits
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 @@ -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();
}
}
Loading