The Helidon code which responds to /health requests applies a timeout (configurable) when it invokes each health check it finds.
The exception does not identify which health check(s) timed out and it would be helpful to developers if it did.
Steps to reproduce
Start with the MP QuickStart app.
Add this to the microprofile-config.properties file: health.timeout-millis=1000
Add this class to the project:
@Liveness
@ApplicationScoped
public class SlowLivenessCheck implements HealthCheck {
@Override
public HealthCheckResponse call() {
try {
TimeUnit.SECONDS.sleep(5);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
return HealthCheckResponse.named("SlowLivenessCheck")
.up()
.build();
}
}
mvn package -DskipTests
java -jar target/helidon-quickstart-mp.jar
From another window: curl http://localhost:8080/health
In the original window you see this (partial) stack trace, noting the timeout as the problem but not identifying the offending health check:
2024.06.11 06:32:29 SEVERE io.helidon.health.HealthSupport Thread[#86,ft-mp-schedule-1,10,main]: Failed to call health checks
java.util.concurrent.TimeoutException
Environment Details
Problem Description
The Helidon code which responds to
/health
requests applies a timeout (configurable) when it invokes each health check it finds.The exception does not identify which health check(s) timed out and it would be helpful to developers if it did.
Steps to reproduce
microprofile-config.properties
file:health.timeout-millis=1000
mvn package -DskipTests
java -jar target/helidon-quickstart-mp.jar
curl http://localhost:8080/health