mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-10 03:19:01 +00:00
Prior to this commit, Spring applications and libraries would call `Schedulers.boundedElastic()` or similar static methods at runtime. This would ininitialize and cache reactive schedulers for the Reactor core library. Those instances are cached for the lifetime of the JVM and are shared static instances. In a WAR deployment case, those schedulers would be initialized and tied to the web application servlet context class loader. When undeploying the web applications, schedulers would not be automatically shut down and this would keep the now useless application classloader, leaking resources. This commit ensures that Spring Boot shuts down shared schedulers if they were loaded and initiazed by the web application classloader, once the the Spring application context is closed. Closes gh-41548