[infinispan-issues] [JBoss JIRA] Updated: (ISPN-1017) Livelock creating lots of cache managers in parallel

Dan Berindei (JIRA) jira-events at lists.jboss.org
Thu Mar 31 12:21:38 EDT 2011


     [ https://issues.jboss.org/browse/ISPN-1017?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Berindei updated ISPN-1017:
-------------------------------

    Git Pull Request: https://github.com/infinispan/infinispan/pull/224


I added double-checked locking around the updates to the component scopes lookup map.
It's a little heavyweight on startup because we will create a new copy of the map every time we update a class, but I figured it will pay off because we only need a volatile access after that.
If the map is not accessed that much after startup then I should change use Collections.synchronizedMap() instead.

> Livelock creating lots of cache managers in parallel
> ----------------------------------------------------
>
>                 Key: ISPN-1017
>                 URL: https://issues.jboss.org/browse/ISPN-1017
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Locking and Concurrency
>    Affects Versions: 4.2.1.FINAL, 5.0.0.ALPHA4
>            Reporter: Dan Berindei
>            Assignee: Dan Berindei
>
> While running the HotRod client test suite I sometimes get a livelock and the thread dump shows a lot of stack traces like this:
> "pool-2-thread-20" prio=10 tid=0x6a63ec00 nid=0x2d71 runnable [0x6943e000]
>    java.lang.Thread.State: RUNNABLE
>         at java.util.HashMap.get(HashMap.java:320)
>         at org.infinispan.factories.ComponentRegistry.isGlobal(ComponentRegistry.java:138)
>         at org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:130)
>         at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185)
>         at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:326)
>         at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:254)
>         at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:843)
>         at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:228)
>         at org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:133)
>         at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185)
>         at org.infinispan.factories.InternalCacheFactory.bootstrap(InternalCacheFactory.java:102)
>         at org.infinispan.factories.InternalCacheFactory.createAndWire(InternalCacheFactory.java:77)
>         at org.infinispan.factories.InternalCacheFactory.createCache(InternalCacheFactory.java:61)
>         at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:538)
>         at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:443)
>         at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:412)
>         at org.infinispan.server.core.AbstractProtocolServer.startDefaultCache(AbstractProtocolServer.scala:108)
>         at org.infinispan.server.core.AbstractProtocolServer.start(AbstractProtocolServer.scala:69)
>         at org.infinispan.server.hotrod.HotRodServer.start(HotRodServer.scala:48)
>         at org.infinispan.server.hotrod.test.HotRodTestingUtil$.startHotRodServer(HotRodTestingUtil.scala:77)
>         at org.infinispan.server.hotrod.test.HotRodTestingUtil$.startHotRodServer(HotRodTestingUtil.scala:57)
>         at org.infinispan.server.hotrod.test.HotRodTestingUtil$.startHotRodServer(HotRodTestingUtil.scala:46)
>         at org.infinispan.server.hotrod.test.HotRodTestingUtil$.startHotRodServer(HotRodTestingUtil.scala:43)
>         at org.infinispan.server.hotrod.test.HotRodTestingUtil$.startHotRodServer(HotRodTestingUtil.scala:37)
>         at org.infinispan.server.hotrod.test.HotRodTestingUtil.startHotRodServer(HotRodTestingUtil.scala)
>         at org.infinispan.client.hotrod.TestHelper.startHotRodServer(TestHelper.java:34)
>         at org.infinispan.client.hotrod.CacheManagerStoppedTest.createCacheManager(CacheManagerStoppedTest.java:31)
> This seems to be caused by the fact that the componentScopesLookup map is not synchronized and multiple threads write to it at the same time, leaving it in an invalid state.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list