Skip to content

Commit f1eef0e

Browse files
committed
Merge branch '3.5.x' into 4.0.x
Closes gh-48946
2 parents 2031ecf + 667e325 commit f1eef0e

File tree

2 files changed

+4
-0
lines changed
  • documentation/spring-boot-docs/src/docs/antora/modules

2 files changed

+4
-0
lines changed

documentation/spring-boot-docs/src/docs/antora/modules/how-to/pages/deployment/cloud.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ Because this shutdown processing happens in parallel (and due to the nature of d
124124

125125
You can configure a sleep execution in a preStop handler to avoid requests being routed to a pod that has already begun shutting down.
126126
This sleep should be long enough for new requests to stop being routed to the pod and its duration will vary from deployment to deployment.
127+
The delay should be at least as long as the longest time it takes to process an in-flight request.
128+
You should not rely on the Spring Boot graceful shutdown period alone, as the platform will not be getting any liveness data in the period that the app is shutting down.
127129

128130
If you're using Kubernetes 1.32 or up, the preStop handler can be configured by using the PodSpec in the pod's configuration file as follows:
129131

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/actuator/endpoints.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,7 @@ When a Spring Boot application shuts down:
10891089
|`REFUSING_TRAFFIC`
10901090
|New requests are rejected
10911091
|If enabled, xref:web/graceful-shutdown.adoc[graceful shutdown processes in-flight requests].
1092+
HTTP probes also stop accepting traffic, so the availability states are not readily available externally.
10921093

10931094
|Shutdown complete
10941095
|N/A
@@ -1098,6 +1099,7 @@ When a Spring Boot application shuts down:
10981099
|===
10991100

11001101
TIP: See xref:how-to:deployment/cloud.adoc#howto.deployment.cloud.kubernetes.container-lifecycle[] for more information about Kubernetes deployment.
1102+
In particular, it describes how to use the `preStop` hook to give your application time to shut down gracefully before Kubernetes kills it.
11011103

11021104

11031105

0 commit comments

Comments
 (0)