Skip to content
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

Enable graceful shutdown by default #37495

Closed
Sineaggi opened this issue Sep 20, 2023 · 3 comments
Closed

Enable graceful shutdown by default #37495

Sineaggi opened this issue Sep 20, 2023 · 3 comments
Labels
status: noteworthy A noteworthy issue to call out in the release notes type: enhancement A general enhancement
Milestone

Comments

@Sineaggi
Copy link

When running in Kubernetes if an application is requested to shutdown, it makes sense to want to handle in-flight connections gracefully during shutdown.

Now that the graceful flag has existed in spring boot for a while can we make it the default?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 20, 2023
@philwebb philwebb added the for: team-meeting An issue we'd like to discuss as a team to make progress label Sep 20, 2023
@philwebb
Copy link
Member

We discussed this today as a team and we'd prefer that graceful shutdown remains an opt-in feature. We discussed enabling it by default automatically on Kubernetes, but we'd rather keep things aligned so that there are no surprises when deploying an app.

@philwebb philwebb closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2023
@philwebb philwebb added type: enhancement A general enhancement status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged for: team-meeting An issue we'd like to discuss as a team to make progress labels Sep 27, 2023
@henry701
Copy link

Most (if not all) container and process monitoring solutions have timeouts in place to kill their monitored subprocess if it takes too long to gracefully exit. Spring itself has a timeout defaulting to just 30 seconds (in case there even are requests that last this long to start with). Other enterprise-grade web frameworks such as ASP.NET Core have a 30 second graceful shutdown by default: https://github.com/dotnet/dotnet-docker/blob/main/samples/kubernetes/graceful-shutdown/graceful-shutdown.md

I understand the concerns, but I urge the team to re-think this as a step toward the future by making the applications built with Spring Boot more ergonomic by default. Can't this be re-evaluated to be scheduled as a breaking change in the next Spring Boot major version, similar to spring-projects/spring-framework#28552?

@philwebb philwebb added the for: team-meeting An issue we'd like to discuss as a team to make progress label Sep 10, 2024
@philwebb philwebb added status: noteworthy A noteworthy issue to call out in the release notes and removed status: declined A suggestion or change that we don't feel we should currently apply for: team-meeting An issue we'd like to discuss as a team to make progress labels Sep 18, 2024
@philwebb philwebb added this to the 3.4.0-M3 milestone Sep 18, 2024
@philwebb
Copy link
Member

Thanks for raising this @henry701. Given the feature has been there for a while, seems stable, and is able to be toggled easily, we're going to try to change the default for our next milestone.

@philwebb philwebb reopened this Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: noteworthy A noteworthy issue to call out in the release notes type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants