Skip to content

Commit b30e5a6

Browse files
committed
Polish
See gh-19593
1 parent b546415 commit b30e5a6

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc

+4
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,10 @@ In case your application needs to rely on a specific subset of health checks for
893893
management.endpoint.health.group.readiness.include=readinessProbe,customCheck
894894
----
895895

896+
WARNING: In general, "Liveness" and "Readiness" probes should avoid being based on external checks, such as <<production-ready-features.adoc#production-ready-health, external Health checks>>.
897+
If an external system fails (e.g. a database, a Web API, an external cache), Kubernetes would react by restarting application instances or spinning up many new instances.
898+
You should carefully consider external checks and how the platform should handle such failures.
899+
896900
WARNING: If your Actuator endpoints are deployed on a separate management context, be aware that endpoints are then not using the same web infrastructure (port, connection pools, framework components) as the main application.
897901
In this case, a Probe check could be successful even if the main application does not work properly (for example, it cannot accept new connections).
898902

spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6039,7 +6039,7 @@ The "Readiness" state of an application tells whether the application is ready t
60396039
A failing "Readiness" state tells Kubernetes that it should not route traffic to the application for now.
60406040
This typically happens during startup, while `CommandLineRunner` and `ApplicationRunner` components are being processed, or at any time if the application decides that it's too busy for additional traffic.
60416041

6042-
An application is considered live as soon as the `ApplicationReadyEvent` has been published, see <<boot-features-application-events-and-listeners, Spring Boot application lifecycle and related Application Events>>.
6042+
An application is considered ready as soon as the `ApplicationReadyEvent` has been published, see <<boot-features-application-events-and-listeners, Spring Boot application lifecycle and related Application Events>>.
60436043

60446044
TIP: Tasks expected to run during startup should be executed by `CommandLineRunner` and `ApplicationRunner` components instead of using Spring component lifecycle callbacks such as `@PostConstruct`.
60456045

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/kubernetes/ApplicationStateProvider.java

-7
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
package org.springframework.boot.kubernetes;
1818

19-
import org.apache.commons.logging.Log;
20-
import org.apache.commons.logging.LogFactory;
21-
2219
import org.springframework.context.ApplicationEvent;
2320
import org.springframework.context.ApplicationListener;
2421

@@ -35,8 +32,6 @@
3532
*/
3633
public class ApplicationStateProvider implements ApplicationListener<ApplicationEvent> {
3734

38-
private static final Log logger = LogFactory.getLog(ApplicationStateProvider.class);
39-
4035
private LivenessState livenessState;
4136

4237
private ReadinessState readinessState;
@@ -63,12 +58,10 @@ public void onApplicationEvent(ApplicationEvent event) {
6358
if (event instanceof LivenessStateChangedEvent) {
6459
LivenessStateChangedEvent livenessEvent = (LivenessStateChangedEvent) event;
6560
this.livenessState = livenessEvent.getLivenessState();
66-
logger.info("Application State is now " + this.livenessState.toString());
6761
}
6862
else if (event instanceof ReadinessStateChangedEvent) {
6963
ReadinessStateChangedEvent readinessEvent = (ReadinessStateChangedEvent) event;
7064
this.readinessState = readinessEvent.getReadinessState();
71-
logger.info("Application State is now " + this.readinessState.toString());
7265
}
7366
}
7467

0 commit comments

Comments
 (0)