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
Spring Boot version: 2.1.2 and above (Tomcat 9.0.14 and above)
Steps to reproduce:
Create a Spring Starter Project with Web MVC and Actuators
Create the following Health-Endpoint:
@Component
public class ExampleHealthIndicator implements InitializingBean, HealthIndicator {
public void afterPropertiesSet() throws Exception {
throw new RuntimeException("Foo");
}
public Health health() {
return Health.up().build();
}
}
Expected Behavior:
There should be some exception messages and the Spring Boot application should shutdown.
Actual Behavior:
The Spring Boot Application does not shutdown. There are 2 remaining non-deamon threads "Catalina-utility-"
Possible Explanation:
AFAIU, there have been the following changes regarding those Catalina-Utility-threads:
They have been made non-deamon. (See org.apache.catalina.core.StandardServer.reconfigureUtilityExecutor(int))
Their threadpool is only shutdown, when Tomcat / Catalina is destroyed (see org.apache.catalina.core.StandardServer.destroyInternal())
In Spring Boot, the following happens:
Tomcat is started in org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize()
The exception occures and is catched.
stopSilently() is called, which stops Tomcat / Catalina but does not destroy it.
Tomcat is never destroyed, since in org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.stopAndReleaseWebServer(), this.webServer is null
since Tomcat is never destroyed, the non-deamon thread pool for Catalina-Utility-threads is not shutdown
the Spring Boot App never terminates
I cannot tell whether this is wrong behavior in Tomcat or whether Spring Boot has to take care about calling destroy in error case.
The text was updated successfully, but these errors were encountered:
Spring Boot version: 2.1.2 and above (Tomcat 9.0.14 and above)
Steps to reproduce:
Expected Behavior:
Actual Behavior:
Possible Explanation:
AFAIU, there have been the following changes regarding those Catalina-Utility-threads:
In Spring Boot, the following happens:
I cannot tell whether this is wrong behavior in Tomcat or whether Spring Boot has to take care about calling destroy in error case.
The text was updated successfully, but these errors were encountered: