Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

375
Visualizações
Spring Boot 2.3 Liveness Probe feature fails in graceful shutdown

I'm testing the new feature graceful shutdown in Spring Boot 2.3 (server.shutdown=graceful and Tomcat Web server) with Kubernetes terminationGracePeriodSeconds field. When the graceful shutdown phase starts, new HTTP requests are rejected as expected and in this time the current requests should be elaborated until configurable timeout (spring.lifecycle.timeout-per-shutdown-phase). The strange behavior is the Spring boot actuator liveness result because, in this scenario, the liveness endpoint is unreachable.

So kubelet cannot know if the microservice is still alive during the shutdown or stuck for other things. Since the K8s liveness probe doesn't rely on terminationGracePeriodSeconds field, the POD will restart according to its K8s liveness configuration and Spring boot microservice cannot perform the graceful shutdown due to brutal restart.

Am I missing something? How could I manage this scenario?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

In meanwhile, I've adopted another solution, I'm invoking the liveness probe of spring boot via JMX using RMI protocol. In this case, the liveness gives an "UP" response during the graceful shutdown. To do this: enable JMX setting the property spring.jmx.enabled to true and the liveness invoke JMX Health indicator using a JMX client.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda