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

BasicComponentRegistryImpl.findFactory() concurrency issue

    Details

      Description

      When 2 threads try to create the same component concurrently and they also end up creating an AutoInstantiableFactory concurrently, one of them may get a NullPointerException.

      org.infinispan.commons.CacheConfigurationException: Failed to construct component org.infinispan.factories.TestDelayFactory, path org.infinispan.factories.TestDelayFactory
      	at org.infinispan.factories.impl.BasicComponentRegistryImpl.doInstantiateWrapper(BasicComponentRegistryImpl.java:169) ~[classes/:?]
      	at org.infinispan.factories.impl.BasicComponentRegistryImpl.instantiateWrapper(BasicComponentRegistryImpl.java:156) ~[classes/:?]
      	at org.infinispan.factories.impl.BasicComponentRegistryImpl.getComponent0(BasicComponentRegistryImpl.java:126) ~[classes/:?]
      	at org.infinispan.factories.impl.BasicComponentRegistryImpl.getComponent(BasicComponentRegistryImpl.java:66) ~[classes/:?]
      	at org.infinispan.factories.impl.BasicComponentRegistryImpl.findFactory(BasicComponentRegistryImpl.java:232) ~[classes/:?]
      	at org.infinispan.factories.impl.BasicComponentRegistryImpl.getComponent0(BasicComponentRegistryImpl.java:113) ~[classes/:?]
      	at org.infinispan.factories.impl.BasicComponentRegistryImpl.getComponent(BasicComponentRegistryImpl.java:66) ~[classes/:?]
      	at org.infinispan.factories.impl.BasicComponentRegistryImpl.getComponent0(BasicComponentRegistryImpl.java:106) ~[classes/:?]
      	at org.infinispan.factories.impl.BasicComponentRegistryImpl.getComponent(BasicComponentRegistryImpl.java:66) ~[classes/:?]
      	at org.infinispan.factories.AbstractComponentRegistry.getComponent(AbstractComponentRegistry.java:232) ~[classes/:?]
      	at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:162) ~[classes/:?]
      	at org.infinispan.factories.ComponentRegistryTest.lambda$testConcurrentLookup$1(ComponentRegistryTest.java:75) ~[test-classes/:?]
      	at org.infinispan.test.AbstractInfinispanTest$CallableWrapper.call(AbstractInfinispanTest.java:528) [test-classes/:?]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
      	at java.lang.Thread.run(Thread.java:834) [?:?]
      Caused by: java.lang.NullPointerException
      	at org.infinispan.factories.impl.BasicComponentRegistryImpl.doInstantiateWrapper(BasicComponentRegistryImpl.java:166) ~[classes/:?]
      	... 16 more
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: