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 #163

Merged
merged 1 commit into from
Nov 20, 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
8 changes: 8 additions & 0 deletions src/main/java/io/cryostat/Health.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import io.cryostat.util.HttpStatusCodeIdentifier;

import io.smallrye.common.annotation.Blocking;
import io.vertx.mutiny.core.buffer.Buffer;
import io.vertx.mutiny.ext.web.client.HttpRequest;
import io.vertx.mutiny.ext.web.client.WebClient;
Expand Down Expand Up @@ -73,6 +74,7 @@ class Health {
@Inject WebClient webClient;

@GET
@Blocking
@Path("/health")
@PermitAll
public Response health() {
Expand Down Expand Up @@ -105,6 +107,12 @@ public Response health() {
}

@GET
// This 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.
@Blocking
@Path("/health/liveness")
@PermitAll
public void liveness() {}
Expand Down
Loading