When configuring additional paths for Spring Boot actuator health groups ('readiness', 'liveness', etc.), unrelated health indicators to those groups unexpectedly start failing. This behavior presents risks for production environments, potentially leading to unnecessary restarts or pod terminations.
Impact:
This issue introduces the risk of unnecessary pod restarts or service disruptions within environments using health endpoints for availability checks (e.g., Kubernetes). A failing health indicator on one path could lead to cascading failures within liveness or readiness probes.
Steps to reproduce:
-
Bootstrap a new project with SpringBoot 3.2.4.
-
Create a custom health indicator that always reports "DOWN":
@Bean
HealthIndicator myHealthIndicator() {
return () -> Health.down().build();
}
-
Add an additional paths to the readiness and liveness groups:
management.endpoint.health.group.readiness.additional-path=server:/readyz
management.endpoint.health.group.liveness.additional-path=server:/livez
Expected behavior (and this works without the additional path configs in step (3)):
/actuator/health - should fail
/actuator/health/readiness - should pass
/readyz - should pass
/actuator/health/liveness - should pass
/livez - should pass
Actual behavior:
/actuator/health - fails
/actuator/health/readiness - fails (unexpectedly)
/readyz - fails (unexpectedly)
/actuator/health/liveness - fails (unexpectedly)
/livez - fails (unexpectedly)
I would have expected readiness and livenss to have failed if I only set the following props:
management.endpoint.health.group.readiness.include=my
management.endpoint.health.group.liveness.include=my
Demo Project (see tests):
demo.zip
Potential Workaround (Temporary):
Avoid using additional-path on health groups where this side-effect could be disruptive.
When configuring additional paths for Spring Boot actuator health groups ('readiness', 'liveness', etc.), unrelated health indicators to those groups unexpectedly start failing. This behavior presents risks for production environments, potentially leading to unnecessary restarts or pod terminations.
Impact:
This issue introduces the risk of unnecessary pod restarts or service disruptions within environments using health endpoints for availability checks (e.g., Kubernetes). A failing health indicator on one path could lead to cascading failures within liveness or readiness probes.
Steps to reproduce:
Bootstrap a new project with SpringBoot
3.2.4.Create a custom health indicator that always reports "DOWN":
Add an additional paths to the
readinessandlivenessgroups:Expected behavior (and this works without the additional path configs in step (3)):
/actuator/health- should fail/actuator/health/readiness- should pass/readyz- should pass/actuator/health/liveness- should pass/livez- should passActual behavior:
/actuator/health- fails/actuator/health/readiness- fails (unexpectedly)/readyz- fails (unexpectedly)/actuator/health/liveness- fails (unexpectedly)/livez- fails (unexpectedly)I would have expected readiness and livenss to have failed if I only set the following props:
Demo Project (see tests):
demo.zip
Potential Workaround (Temporary):
Avoid using
additional-pathon health groups where this side-effect could be disruptive.