Skip to content

Spring Framework 6.2.6: deadlock when starting application after migration Spring Boot 3.3.11 to 3.4.5 #34874

@stefan-schilling

Description

@stefan-schilling

Hello,
we're trying to migrate our applications from Spring Boot 3.3.11 (actually: 3.2.12, but everything seems to be working w/ 3.3.x). We've done that successfully for 9 of them, but 1 is showing failure below:
One of the modules define Quartz-based schedulers (total of 14), of which 3 have an issue, which kind of looks like a deadlock when launching the application.

It always gets to the message

51532 [main] INFO  org.quartz.core.QuartzScheduler - Scheduler quartzScheduler_$_linex0141746794695894 started. 
52675 [main] INFO  o.s.d.j.r.q.QueryEnhancerFactory - Hibernate is in classpath; If applicable, HQL parser will be used. 

Then we get log messages such as

51532 [main] INFO  org.quartz.core.QuartzScheduler - Scheduler quartzScheduler_$_linex0141746794695894 started. 
52675 [main] INFO  o.s.d.j.r.q.QueryEnhancerFactory - Hibernate is in classpath; If applicable, HQL parser will be used. 
52817 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'manualReactivationActivationService' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, dealerService] 
52818 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'manualReactivationActivationWorker' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, dealerService, manualReactivationActivationService] 
52821 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'vehicleActivationService' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, manualReactivationActivationWorker, dealerService, manualReactivationActivationService] 
52825 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'VSActivationFacadeFactory' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, manualReactivationActivationWorker, dealerService, manualReactivationActivationService, vehicleActivationService] 
52828 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'liveActivationFacade' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, manualReactivationActivationWorker, dealerService, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
52830 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'VSRestTemplateFactory' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, manualReactivationActivationWorker, dealerService, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
52833 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'vehicleServiceMileageTemplate' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
52838 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'vsRestTemplate' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
52838 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'VSRestTemplateConfig' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, vsRestTemplate, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
52912 [quartzScheduler_QuartzSchedulerThread] INFO  c.e.d.g.c.vs.VSRestTemplateConfig - Trying to set proxy for rest template. Host:  Port:  
52937 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'vehicleservice-com.exxeta.dfstp.geofence.core.vs.VehicleServiceConfig' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
52976 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'vehicleServiceExceptionHandler' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
52992 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'vehicleServiceGeneralSubscriptionTemplate' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
53092 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'circuitBreakerAspect' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
53092 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'io.github.resilience4j.springboot3.circuitbreaker.autoconfigure.CircuitBreakerConfigurationOnMissingBean' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
53094 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'resilience4j.circuitbreaker-io.github.resilience4j.springboot3.circuitbreaker.autoconfigure.CircuitBreakerProperties' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, io.github.resilience4j.springboot3.circuitbreaker.autoconfigure.CircuitBreakerConfigurationOnMissingBean, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
53396 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'circuitBreakerRegistry' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
53397 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'eventConsumerRegistry' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, circuitBreakerRegistry, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
53443 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'circuitBreakerRegistryEventConsumer' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, circuitBreakerRegistry, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
53447 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'taggedCircuitBreakerMetricsPublisher' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, circuitBreakerRegistryEventConsumer, liveActivationFacade, VSRestTemplateFactory, circuitBreakerRegistry, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
53449 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'io.github.resilience4j.springboot3.circuitbreaker.autoconfigure.CircuitBreakerMetricsAutoConfiguration' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, circuitBreakerRegistryEventConsumer, liveActivationFacade, taggedCircuitBreakerMetricsPublisher, VSRestTemplateFactory, circuitBreakerRegistry, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
53545 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'compositeCircuitBreakerCustomizer' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, circuitBreakerRegistry, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
53718 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'fallbackExecutor' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
53725 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'io.github.resilience4j.springboot3.fallback.autoconfigure.FallbackConfigurationOnMissingBean' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, fallbackExecutor, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
53746 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'spelResolver' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, fallbackExecutor, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
53747 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'io.github.resilience4j.springboot3.spelresolver.autoconfigure.SpelResolverConfigurationOnMissingBean' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, fallbackExecutor, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, spelResolver, circuitBreakerAspect, vehicleActivationService] 
53762 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'spelExpressionParser' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, fallbackExecutor, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, spelResolver, circuitBreakerAspect, vehicleActivationService] 
53769 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'parameterNameDiscoverer' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, fallbackExecutor, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, spelResolver, circuitBreakerAspect, vehicleActivationService] 
53797 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'fallbackDecorators' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, fallbackExecutor, manualReactivationActivationWorker, dealerService, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
53801 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'completionStageFallbackDecorator' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, fallbackExecutor, manualReactivationActivationWorker, dealerService, fallbackDecorators, vehicleServiceMileageTemplate, VSActivationFacadeFactory, manualReactivationActivationService, circuitBreakerAspect, vehicleActivationService] 
54117 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'vehicleServicePositionOffTemplate' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
54121 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'stockService' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, vehicleServicePositionOffTemplate, addDealerConcurrentWfsImportProcessService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
54128 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'vehicleRepositoryImpl' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, vehicleServicePositionOffTemplate, addDealerConcurrentWfsImportProcessService, stockService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
54150 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'vehicleRepository' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, vehicleServicePositionOffTemplate, addDealerConcurrentWfsImportProcessService, stockService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, dealerService, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
54153 [quartzScheduler_QuartzSchedulerThread] INFO  o.s.b.f.s.DefaultListableBeanFactory - Obtaining singleton bean 'jpa.named-queries#1' in thread "quartzScheduler_QuartzSchedulerThread" while other thread holds singleton lock for other beans [dealerRepository, vehicleServicePositionOffTemplate, addDealerConcurrentWfsImportProcessService, stockService, liveActivationFacade, VSRestTemplateFactory, manualReactivationActivationWorker, vehicleRepository, dealerService, VSActivationFacadeFactory, manualReactivationActivationService, vehicleActivationService] 
170041 [QuartzScheduler_quartzScheduler-linex0141746794695894_MisfireHandler] INFO  o.s.s.q.LocalDataSourceJobStore - Handling 4 trigger(s) that missed their scheduled fire-time. 

The last message gets repeated after some time, I guess, Quartz notices, that a job wasn't finished.

But the application does not continue to be fully started (e.g. Tomcat won't finish its boot and therefore does not request any ports for it).
Sadly, I cannot debug this, since logging class o.s.b.f.s.DefaultListableBeanFactory doesn't print message "Obtaining singleton bean ..." anywhere. So I don't know where to look.

On the other hand, if I disable the 3 (out of 14) schedulers, the application will boot successfully.

I never get any error message, so there seems to be no timeout involved.

Since we're using Spring Framework 6.2.6, we're not getting
org.springframework.beans.factory.BeanCurrentlyInCreationException as #34373 reported.

I cannot give you a reduced sample application, since our code seems to be ok (all services injected here are used by other services, too - but their presence does not prevent the application from starting). It fails for this specific combination only. And: though it currently quite persistently fails on my machine, my colleague currently cannot reproduce the issue using Intellij - but when he runs the jar file on his Mac, it fails there, too.

Sorry for being so unspecific, but this looks like a time/order related thing.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions