Alex,

Does it mean you could reproduce the issue in 2.1 and confirm it doesn’t exist 
in 2.0? I’m curious what happened in 2.1 release so that we got this bug.

—
Denis

> On Aug 29, 2017, at 1:01 PM, afedotov <[email protected]> wrote:
> 
> Hi,
> 
> Looks like with IgniteSpringBean and a @SpringResource configured for a 
> CacheStore a deadlock occurs, since
> IgniteSpringBean singleton creation takes a Spring internal lock and after 
> that tries to start a cache with a CacheStore in a separate thread in a 
> synchronous way,
> it sees that a @SpringResource should be injected, takes the Spring context 
> and tries to fetch a corresponding bean from it, but it implies a 
> corresponding 
> singleton instantiation and the same lock being held by the main thread is 
> attempted to be acquired.
> I will file a ticket for the issue.
> 
> As a workaround you could consider creating Ignite instance in the following 
> way
> @Bean(destroyMethod = "close")
> public Ignite ignite() {
>     return Ignition.start(igniteConfig());
> }
> 
> where igniteConfig() returns proper config. 
> 
> 
> Kind regards,
> Alex.
> 
> On Tue, Aug 29, 2017 at 7:28 PM, Denis Magda-2 [via Apache Ignite Users] 
> <[hidden email] <x-msg://19/user/SendEmail.jtp?type=node&node=16519&i=0>> 
> wrote:
> Igor, 
> 
> Could you share a test to reproduce the issue? 
> 
> — 
> Denis 
> 
> 
> > On Aug 29, 2017, at 3:59 AM, igor.tanackovic <[hidden email] 
> > <http://user/SendEmail.jtp?type=node&node=16510&i=0>> wrote: 
> > 
> > Upgraded Ignite from 2.0.0 to 2.1.0 and ran into a thread deadlock on 
> > Ignite 
> > startup. I noticed the deadlock once I added CacheStore into a cache 
> > configuration which has Spring Data repository injected using 
> > @SpringResource. Ignite hangs during startup with one of executor threads 
> > blocked. 
> > 
> > java.lang.Thread.State: BLOCKED (on object monitor) 
> > at 
> > org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:188)
> >  
> > - waiting to lock <0x0000000790d4e9b8> (a 
> > java.util.concurrent.ConcurrentHashMap) 
> > at 
> > org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:486)
> >  
> > at 
> > org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:432)
> >  
> > at 
> > org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:403)
> >  
> > at 
> > org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:389)
> >  
> > at 
> > org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1002)
> >  
> > at 
> > org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:345)
> >  
> > at 
> > org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:340)
> >  
> > at 
> > org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1090)
> >  
> > at 
> > org.apache.ignite.internal.processors.resource.GridResourceSpringBeanInjector.getBeanByResourceAnnotation(GridResourceSpringBeanInjector.java:122)
> >  
> > at 
> > org.apache.ignite.internal.processors.resource.GridResourceSpringBeanInjector.inject(GridResourceSpringBeanInjector.java:64)
> >  
> > at 
> > org.apache.ignite.internal.processors.resource.GridResourceIoc$ClassDescriptor.injectInternal(GridResourceIoc.java:440)
> >  
> > at 
> > org.apache.ignite.internal.processors.resource.GridResourceIoc$ClassDescriptor.inject(GridResourceIoc.java:470)
> >  
> > at 
> > org.apache.ignite.internal.processors.resource.GridResourceProcessor.inject(GridResourceProcessor.java:278)
> >  
> > at 
> > org.apache.ignite.internal.processors.resource.GridResourceProcessor.inject(GridResourceProcessor.java:248)
> >  
> > at 
> > org.apache.ignite.internal.processors.resource.GridResourceProcessor.injectGeneric(GridResourceProcessor.java:229)
> >  
> > at 
> > org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepare(GridCacheProcessor.java:609)
> >  
> > at 
> > org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepare(GridCacheProcessor.java:598)
> >  
> > at 
> > org.apache.ignite.internal.processors.cache.GridCacheProcessor.createCache(GridCacheProcessor.java:1416)
> >  
> > at 
> > org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1867)
> >  
> > at 
> > org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCachesOnLocalJoin(GridCacheProcessor.java:1755)
> >  
> > at 
> > org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:619)
> >  
> > at 
> > org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1901)
> >  
> > at 
> > org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110) 
> > at java.lang.Thread.run(Thread.java:745) 
> > 
> >   Locked ownable synchronizers: 
> > - None 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > View this message in context: 
> > http://apache-ignite-users.70518.x6.nabble.com/Ignite-2-1-0-Thread-deadlock-on-DefaultSingletonBeanRegistry-getSingleton-tp16481.html
> >  
> > <http://apache-ignite-users.70518.x6.nabble.com/Ignite-2-1-0-Thread-deadlock-on-DefaultSingletonBeanRegistry-getSingleton-tp16481.html>
> > Sent from the Apache Ignite Users mailing list archive at Nabble.com.
> 
> 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-2-1-0-Thread-deadlock-on-DefaultSingletonBeanRegistry-getSingleton-tp16481p16510.html
>  
> <http://apache-ignite-users.70518.x6.nabble.com/Ignite-2-1-0-Thread-deadlock-on-DefaultSingletonBeanRegistry-getSingleton-tp16481p16510.html>
> To start a new topic under Apache Ignite Users, email [hidden email] 
> <x-msg://19/user/SendEmail.jtp?type=node&node=16519&i=1> 
> To unsubscribe from Apache Ignite Users, click here 
> <applewebdata://88380FA1-10E9-4667-83D5-4FB0F5E56A86>.
> NAML 
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> 
> View this message in context: Re: Ignite 2.1.0 - Thread deadlock on 
> DefaultSingletonBeanRegistry.getSingleton 
> <http://apache-ignite-users.70518.x6.nabble.com/Ignite-2-1-0-Thread-deadlock-on-DefaultSingletonBeanRegistry-getSingleton-tp16481p16519.html>
> Sent from the Apache Ignite Users mailing list archive 
> <http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com 
> <http://nabble.com/>.

Reply via email to