Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

369
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!