Skip to content

Commit

Permalink
fix(liveness): execute on worker pool (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored Nov 20, 2023
1 parent 6501b64 commit af46d32
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit af46d32

Please sign in to comment.