Skip to content

Liveness and readiness probes return down when lazy initialization is enabled #35161

@Storje

Description

@Storje

Since Spring Boot 3.0.6, Liveness and Readiness probes return 503 (DOWN)

With this configuration :

spring: main: lazy-initialization: true cloud-platform: KUBERNETES management: security: enabled: false endpoints: web.exposure.include: info,health,prometheus

The following test is red :

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @AutoConfigureObservability class SupervisionIntegrationTest { @Autowired lateinit var restTemplate: TestRestTemplate @Test fun livenessProbe() { val response = restTemplate.getForEntity("/actuator/health/liveness", String::class.java) assertThat(response.statusCode).isEqualTo(HttpStatus.OK) } @Test fun readinessProbe() { val response = restTemplate.getForEntity("/actuator/health/readiness", String::class.java) assertThat(response.statusCode).isEqualTo(HttpStatus.OK) } }

The same test with Spring Boot 3.0.5 is ok.
With 3.0.6, if spring.main.cloud-platform is removed, the health probe is ok. When k8s probes are added, the health becomes down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: regressionA regression from a previous release

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions