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
Apparently with lazy="true", the CountDownLatch is not being called. I'm looking into that.
One other workaround for the moment would be to register your own bean named "lifecycleProcessor" of type DefaultLifecycleProcessor. Then you can set a lower value for the "timeout" property (its default is 30 seconds).
This actually triggered the resolution of a more general issue. The DefaultLifecycleProcessor was waiting on all SmartLifecycle beans to stop, but it was only calling stop(callback) for those that were already running. So, now I am counting down the latch for any SmartLifecycle bean that is not even running in the first place.
I added a couple test cases for the specific Quartz scheduler case.
David Gageot opened SPR-6354 and commented
The following code takes less than a second to run with version 3.0RC1. With 3.0RC2, it takes more than 30s.
The problem seems to come from the combination of SchedulerFactoryBean and lazy=true.
With lazy=false, everything is ok.
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
Object bean = context.getBean("quartzScheduler");
context.destroy();
<bean id="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="true" />
Here is the output log:
Nov 13, 2009 11:05:17 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@5265a77f: startup date [Fri Nov 13 23:05:17 CET 2009]; root of context hierarchy
Nov 13, 2009 11:05:17 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
Nov 13, 2009 11:05:18 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@8888e6c: defining beans [quartzScheduler]; root of factory hierarchy
Nov 13, 2009 11:05:18 PM org.quartz.core.SchedulerSignalerImpl <init>
INFO: Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
Nov 13, 2009 11:05:18 PM org.quartz.core.QuartzScheduler <init>
INFO: Quartz Scheduler v.1.6.2 created.
Nov 13, 2009 11:05:18 PM org.quartz.simpl.RAMJobStore initialize
INFO: RAMJobStore initialized.
Nov 13, 2009 11:05:18 PM org.quartz.impl.StdSchedulerFactory instantiate
INFO: Quartz scheduler 'quartzScheduler' initialized from an externally provided properties instance.
Nov 13, 2009 11:05:18 PM org.quartz.impl.StdSchedulerFactory instantiate
INFO: Quartz scheduler version: 1.6.2
Nov 13, 2009 11:05:18 PM org.quartz.core.QuartzScheduler setJobFactory
INFO: JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactory@49938039
Nov 13, 2009 11:05:18 PM org.springframework.context.support.AbstractApplicationContext doClose
INFO: Closing org.springframework.context.support.ClassPathXmlApplicationContext@5265a77f: startup date [Fri Nov 13 23:05:17 CET 2009]; root of context hierarchy
Nov 13, 2009 11:05:48 PM org.springframework.context.support.DefaultLifecycleProcessor$ShutdownGroup shutdown
WARNING: failed to shutdown beans with order 2147483647 within timeout of 30000
Nov 13, 2009 11:05:48 PM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@8888e6c: defining beans [quartzScheduler]; root of factory hierarchy
Nov 13, 2009 11:05:48 PM org.springframework.scheduling.quartz.SchedulerFactoryBean destroy
INFO: Shutting down Quartz Scheduler
Nov 13, 2009 11:05:48 PM org.quartz.core.QuartzScheduler shutdown
INFO: Scheduler quartzScheduler_$_NON_CLUSTERED shutting down.
Nov 13, 2009 11:05:48 PM org.quartz.core.QuartzScheduler standby
INFO: Scheduler quartzScheduler_$_NON_CLUSTERED paused.
Nov 13, 2009 11:05:48 PM org.quartz.core.QuartzScheduler shutdown
INFO: Scheduler quartzScheduler_$_NON_CLUSTERED shutdown complete.
Affects: 3.0 RC2
Issue Links:
Referenced from: commits c6f3613
The text was updated successfully, but these errors were encountered: