Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1051

Potential concurrency issues when retrieving a cache concurrently (for the first time)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 4.2.1.FINAL, 5.0.0.BETA1
    • Fix Version/s: 5.0.0.BETA2
    • Component/s: Core
    • Labels:
      None

      Description

      My code initialize the CacheManager but retrieve the cache only "on demand". Several threads do access cacheManager.getCache(namedCache); concurrently.

      I am experiencing the following exceptions

      Caused by: org.infinispan.config.ConfigurationException: Component factory class org.infinispan.factories.EmptyConstructorFactory incorrectly registered! Debug stack: null
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.getFactory(AbstractComponentRegistry.java:365)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:317)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:254)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:843)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:228)
           [java] 	at org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:131)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:326)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:254)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:843)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:228)
           [java] 	at org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:133)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:326)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:254)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:843)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:228)
           [java] 	at org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:133)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:326)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:254)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:843)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:228)
           [java] 	at org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:133)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185)
           [java] 	at org.infinispan.factories.InternalCacheFactory.bootstrap(InternalCacheFactory.java:102)
           [java] 	at org.infinispan.factories.InternalCacheFactory.createAndWire(InternalCacheFactory.java:77)
           [java] 	at org.infinispan.factories.InternalCacheFactory.createCache(InternalCacheFactory.java:61)
           [java] 	at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:538)
           [java] 	at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:443)
           [java] 	at org.hibernate.ogm.metadata.GridMetadataManagerHelper.getEntityCache(GridMetadataManagerHelper.java:68)
           [java] 	at org.hibernate.ogm.metadata.GridMetadataManagerHelper.getEntityCache(GridMetadataManagerHelper.java:63)
      

      As well as rarely

           [java] Caused by: java.util.ConcurrentModificationException
           [java] 	at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
           [java] 	at java.util.AbstractList$Itr.next(AbstractList.java:343)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:843)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:228)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:326)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:254)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:843)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:228)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:326)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:254)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:843)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:228)
           [java] 	at org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:131)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:326)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:254)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:843)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:228)
           [java] 	at org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:133)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:326)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:254)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:843)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:228)
           [java] 	at org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:133)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:326)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:254)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:843)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:228)
           [java] 	at org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:133)
           [java] 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185)
           [java] 	at org.infinispan.factories.InternalCacheFactory.bootstrap(InternalCacheFactory.java:102)
           [java] 	at org.infinispan.factories.InternalCacheFactory.createAndWire(InternalCacheFactory.java:77)
           [java] 	at org.infinispan.factories.InternalCacheFactory.createCache(InternalCacheFactory.java:61)
           [java] 	at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:538)
           [java] 	at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:443)
           [java] 	at org.hibernate.ogm.metadata.GridMetadataManagerHelper.getIdentifierCache(GridMetadataManagerHelper.java:74)
      

        Attachments

          Activity

            People

            Assignee:
            dan.berindei Dan Berindei
            Reporter:
            epbernard Emmanuel Bernard
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: