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?

Comment From: philwebb

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.

Comment From: henry701

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 https://github.com/spring-projects/spring-framework/issues/28552?

Comment From: philwebb

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.