Skip to content

Configurable waiting time before graceful shutdown starts (to let kubernetes pick up new readiness state) #22487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
larsduelfer opened this issue Jul 21, 2020 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@larsduelfer
Copy link

I started to use the new graceful shutdown feature of spring boot. When running on kubernetes, the readiness probe is usually done periodically (i.e. every 5 seconds). When the application receives a termination signal, the readiness state is changed to "OUT_OF_SERVICE" and the application stops accepting requests. Kubernetes still routes traffic to the application until it picks up the changed readiness state (in our scenarion at least after 5 seconds). Therefore, I would like to configure a time that the application waits before actually starting the graceful shutdown and during which the application still accepts incoming requests.

Maybe I have overseen something here. If not, a configuration property for this would be very useful.

So far, I added it myself with an additional ApplicationListener using a Thread.sleep() inside it. But since this is now a built-in Spring Boot feature it would be awesome if this is also provided right out-of-the-box.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 21, 2020
@wilkinsona
Copy link
Member

Thanks for the suggestion. Our current recommendation is to configure a pre-stop handler. #20995 is adding the delay to Spring Boot itself.

@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants