You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure management.port=8081 , then in app startup process, when access http://localhost:8081/health or http://localhost:8081/health/readiness will get 200, which means app already start up success.
The reason : 8081 is opened before app startup finish. Port 8081 is open by org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration after root application initialize all beans(before ContextRefreshedEvent)
OverridepublicvoidafterSingletonsInstantiated() {
ManagementServerPortmanagementPort = ManagementServerPort.DIFFERENT;
if (this.applicationContextinstanceofWebApplicationContext) {
managementPort = ManagementServerPort
.get(this.applicationContext.getEnvironment(), this.beanFactory);
}
if (managementPort == ManagementServerPort.DIFFERENT) {
if (this.applicationContextinstanceofEmbeddedWebApplicationContext
&& ((EmbeddedWebApplicationContext) this.applicationContext)
.getEmbeddedServletContainer() != null) {
createChildManagementContext();
}
else {
logger.warn("Could not start embedded management container on "
+ "different port (management endpoints are still available "
+ "through JMX)");
}
}
if (managementPort == ManagementServerPort.SAME) {
if (newRelaxedPropertyResolver(this.applicationContext.getEnvironment(),
"management.ssl.").getProperty("enabled") != null) {
thrownewIllegalStateException(
"Management-specific SSL cannot be configured as the management "
+ "server is not listening on a separate port");
}
if (this.applicationContext
.getEnvironment() instanceofConfigurableEnvironment) {
addLocalManagementPortPropertyAlias(
(ConfigurableEnvironment) this.applicationContext
.getEnvironment());
}
}
}
However readiness healthcheck is done after ContextRefreshedEvent , and in isle scenario , all sofaboot modules are refreshed after ContextRefreshedEvent .
The early result 200 may cause serious problems on production.
The text was updated successfully, but these errors were encountered:
straybirdzls
changed the title
When configure management.port,in app startup process,HealthCheckManager will throw NPE
When configure management.port,in app startup process,readiness/runtime health check result will return succes
Dec 29, 2018
straybirdzls
changed the title
When configure management.port,in app startup process,readiness/runtime health check result will return succes
When configure management.port,in app startup process,readiness/runtime health check result may return succes
Dec 29, 2018
straybirdzls
changed the title
When configure management.port,in app startup process,readiness/runtime health check result may return succes
When configure management.port,readiness/runtime health check result may return success in app startup process
Dec 29, 2018
Configure
management.port=8081
, then in app startup process, when accesshttp://localhost:8081/health
orhttp://localhost:8081/health/readiness
will get 200, which means app already start up success.The reason : 8081 is opened before app startup finish. Port 8081 is open by
org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration
after root application initialize all beans(beforeContextRefreshedEvent
)However readiness healthcheck is done after
ContextRefreshedEvent
, and in isle scenario , all sofaboot modules are refreshed afterContextRefreshedEvent
.The early result 200 may cause serious problems on production.
The text was updated successfully, but these errors were encountered: