Deadlock with spring.data.jpa.repositories.bootstrap-mode=deferred
See original GitHub issueSpring Boot 2.1.0.RELEASE Spring Cloud Greenwich.M1 (also Finchley.SR2)
Create a project with both spring-boot-starter-data-jpa and spring-cloud-starter-zipkin.
Set the new spring.data.jpa.repositories.bootstrap-mode=deferred
.
Deadlock during startup.
Created minimal sample as a mashup of spring initialir with jpa and zipkin together with a simple entity and repository.
Steps to reproduce: Unpack attached project. Run “mvn clean test”
Remove the spring.data.jpa.repositories.bootstrap-mode=deferred
line in application.properties and rerun to see test completing with sleuth.
Keep the property and remove the spring-cloud.-starter-zipkin dependency in the pom to see test completing without sleuth.
Main thread locks in LocalContainerEntityManagerFactoryBean(AbstractEntityManagerFactoryBean).getNativeEntityManagerFactory() line: 539 [return this.nativeEntityManagerFactoryFuture.get();]
JPA setup thread locks in DefaultListableBeanFactory(DefaultSingletonBeanRegistry).getSingleton(String, boolean) line: 179 [synchronized (this.singletonObjects) { ]
JPA setup thread stack:
waiting for: ConcurrentHashMap<K,V> (id=84)
DefaultListableBeanFactory(DefaultSingletonBeanRegistry).getSingleton(String, boolean) line: 179
DefaultListableBeanFactory(AbstractBeanFactory).isTypeMatch(String, ResolvableType) line: 493
DefaultListableBeanFactory.doGetBeanNamesForType(ResolvableType, boolean, boolean) line: 514
DefaultListableBeanFactory.getBeanNamesForType(Class<?>, boolean, boolean) line: 485
DefaultListableBeanFactory.getBeanNamesForType(ResolvableType) line: 462
DefaultListableBeanFactory.resolveNamedBean(ResolvableType, Object[], boolean) line: 1098
DefaultListableBeanFactory.resolveBean(ResolvableType, Object[], boolean) line: 407
DefaultListableBeanFactory.getBean(Class<T>, Object...) line: 341
DefaultListableBeanFactory.getBean(Class<T>) line: 335
LazyTraceThreadPoolTaskExecutor.tracing() line: 231
LazyTraceThreadPoolTaskExecutor.execute(Runnable) line: 60
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 498
ExecutorBeanPostProcessor$1(ExecutorMethodInterceptor<T>).invoke(MethodInvocation) line: 148
CglibAopProxy$CglibMethodInvocation(ReflectiveMethodInvocation).proceed() line: 186
CglibAopProxy$DynamicAdvisedInterceptor.intercept(Object, Method, Object[], MethodProxy) line: 688
ThreadPoolTaskExecutor$$EnhancerBySpringCGLIB$$a86302b9.execute(Runnable) line: not available
DataSourceInitializedPublisher$DataSourceSchemaCreatedPublisher.postProcessEntityManagerFactory(EntityManagerFactory) line: 201
LocalContainerEntityManagerFactoryBean(AbstractEntityManagerFactoryBean).buildNativeEntityManagerFactory() line: 411
1974379194.call() line: not available
TraceCallable<V>.call() line: 63
FutureTask<V>.run() line: 266
ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1149
ThreadPoolExecutor$Worker.run() line: 624
Thread.run() line: 748
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (3 by maintainers)
same issue here with Hoxton SR9 and spring boot 2.3.4, any workaround ?
Hi, i’m experiencing the deadlock with spring boot 2.3.4 and spring cloud Hoxton.SR8 release train.
A thread dump shows:
On github i’ve published my application to help reproduce the issue.