We are using Quartz for job scheduling in our Spring Boot application, and we've encountered a warning related to the schedulers during shutdown. The warning appears when the Tomcat server stops and the application context is destroyed. The warning is as follows:
WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [test-app] appears to have started a thread named [test_app_Worker-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.base@17.0.10/java.lang.Object.wait(Native Method)
We understand that Quartz manages the job executions, and jobs should stop when the application shuts down. As we are using Quartz to manage our scheduled jobs, we assume that this warning is triggered when the application context is destroyed after Tomcat shuts down. We wanted to confirm that this warning won't cause any issues, and it is part of Quartz’s normal behavior during shutdown.
Could you please confirm if this is expected behavior, or if there is anything specific we need to handle in our Spring Boot application setup to avoid potential issues? We will also be reviewing our setup to ensure no configuration or resource cleanup is missed.
Comment From: wilkinsona
Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.