Quartz threads "leaked" after shutdown #12

candrews opened this Issue Nov 14, 2012 · 3 comments


None yet
3 participants

Quartz's Scheduler.shutdown() tells the threads to shut down, but doesn't wait for them to shut down. This mean that the plugin will shut down Quartz, then immediately the app destroy finishes, which indicates to Tomcat (or any other servlet container) that the app is destroyed. The container then checks to see if any threads are alive, which there may be as the Quartz threads may have not yet shut down. Tomcat, for example, reports this as a memory leak.

Here's the issue reported at Quartz: https://jira.terracotta.org/jira/browse/QTZ-122

The accepted workaround seems to be to put a Thread.sleep(1000) after calling shutdown(). This would be interested at https://github.com/9ci/grails-quartz2/blob/master/src/groovy/grails/plugin/quartz2/QuartzFactoryBean.groovy#L202

quorak commented Dec 10, 2012



basejump commented Dec 13, 2012

Not a really pretty solution as stated in the jira but we can add it.
Will be doing a release shortly and can incorporate this


basejump commented Jan 25, 2013

fixed in new plugin release

basejump closed this Jan 25, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment