-
Bug
-
Resolution: Done
-
Major
-
RHDG 8.5.1 GA
-
None
Describe the bug
RemoteCacheManager.findConfiguration(String) iterates over the Map<String, RemoteCacheConfiguration> returned via Configuration.remoteCaches().
As of ISPN-11960, this map may be modified after the Configuration is created, and so iterate over this map requires exclusive access.
If another thread calls Configuration.addRemoteCache(...), a concurrent call to RemoteCacheManager.getCache(...) will fail with the following:
ISPN000660: Cache HotRodPersistentTimerServiceTestCase.war.AutoTransientTimerBean.PERSISTENT start failed, stopping any running components: org.infinispan.commons.CacheConfigurationException: ISPN000659: Component ComponentWrapper{name=org.infinispan.persistence.manager.PersistenceManager, instance=org.infinispan.persistence.manager.PersistenceManagerImpl@2e8de287, status=FAILED} failed to start
at org.infinispan.core@15.0.11.Final//org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:584)
at org.infinispan.core@15.0.11.Final//org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:807)
at org.infinispan.core@15.0.11.Final//org.infinispan.factories.ComponentRegistry.getLocalComponent(ComponentRegistry.java:187)
at org.infinispan.core@15.0.11.Final//org.infinispan.factories.ComponentRegistry.getLocalComponent(ComponentRegistry.java:192)
at org.wildfly.clustering.cache.infinispan.embedded@4.0.5.Final//org.wildfly.clustering.cache.infinispan.embedded.lifecycle.WildFlyClusteringModuleLifecycle.cacheStarting(WildFlyClusteringModuleLifecycle.java:31)
at org.infinispan.core@15.0.11.Final//org.infinispan.factories.ComponentRegistry.notifyCacheStarting(ComponentRegistry.java:270)
at org.infinispan.core@15.0.11.Final//org.infinispan.factories.ComponentRegistry.preStart(ComponentRegistry.java:257)
at org.infinispan.core@15.0.11.Final//org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:241)
at org.infinispan.core@15.0.11.Final//org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:222)
at org.infinispan.core@15.0.11.Final//org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:1037)
at org.infinispan.core@15.0.11.Final//org.infinispan.cache.impl.AbstractDelegatingCache.start(AbstractDelegatingCache.java:512)
at org.infinispan.core@15.0.11.Final//org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:726)
at org.infinispan.core@15.0.11.Final//org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:672)
at org.infinispan.core@15.0.11.Final//org.infinispan.manager.DefaultCacheManager.internalGetCache(DefaultCacheManager.java:565)
at org.infinispan.core@15.0.11.Final//org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:580)
at org.jboss.as.clustering.infinispan@35.0.0.Beta1-SNAPSHOT//org.jboss.as.clustering.infinispan.manager.DefaultCacheContainer$1.run(DefaultCacheContainer.java:110)
at org.jboss.as.clustering.infinispan@35.0.0.Beta1-SNAPSHOT//org.jboss.as.clustering.infinispan.manager.DefaultCacheContainer$1.run(DefaultCacheContainer.java:107)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at org.jboss.as.clustering.infinispan@35.0.0.Beta1-SNAPSHOT//org.jboss.as.clustering.infinispan.manager.DefaultCacheContainer.getCache(DefaultCacheContainer.java:107)
at org.jboss.as.clustering.infinispan@35.0.0.Beta1-SNAPSHOT//org.jboss.as.clustering.infinispan.manager.DefaultCacheContainer.getCache(DefaultCacheContainer.java:102)
at org.wildfly.clustering.infinispan.embedded.service@35.0.0.Beta1-SNAPSHOT//org.wildfly.clustering.infinispan.service.CacheServiceInstaller$1.apply(CacheServiceInstaller.java:40)
at org.wildfly.clustering.infinispan.embedded.service@35.0.0.Beta1-SNAPSHOT//org.wildfly.clustering.infinispan.service.CacheServiceInstaller$1.apply(CacheServiceInstaller.java:37)
at org.wildfly.subsystem@27.0.0.Beta4//org.wildfly.subsystem.service.ServiceDependency$2.get(ServiceDependency.java:59)
at org.wildfly.service@27.0.0.Beta4//org.wildfly.service.Installer$UnaryService.start(Installer.java:443)
at org.wildfly.service@27.0.0.Beta4//org.wildfly.service.AsyncServiceBuilder$AsyncService.lambda$start$0(AsyncServiceBuilder.java:87)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:1575)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: java.util.concurrent.CompletionException: java.util.ConcurrentModificationException
at java.base/java.util.concurrent.CompletableFuture.wrapInCompletionException(CompletableFuture.java:323)
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:359)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:364)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1851)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1348)
at org.wildfly.clustering.context@4.0.5.Final//org.wildfly.clustering.context.ContextualExecutor$1.execute(ContextualExecutor.java:180)
at org.wildfly.clustering.context@4.0.5.Final//org.wildfly.clustering.context.ContextualExecutor.execute(ContextualExecutor.java:31)
at org.wildfly.clustering.context@4.0.5.Final//org.wildfly.clustering.context.Contextualizer$2$1.run(Contextualizer.java:220)
at java.base/java.lang.Thread.run(Thread.java:1575)
Caused by: java.util.ConcurrentModificationException
at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1606)
at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1639)
at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1637)
at java.base/java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$1.next(Collections.java:1865)
at java.base/java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$1.next(Collections.java:1858)
at org.infinispan.client.hotrod@15.0.11.Final//org.infinispan.client.hotrod.RemoteCacheManager.findConfiguration(RemoteCacheManager.java:492)
at org.infinispan.client.hotrod@15.0.11.Final//org.infinispan.client.hotrod.RemoteCacheManager.createRemoteCache(RemoteCacheManager.java:503)
at org.infinispan.client.hotrod@15.0.11.Final//org.infinispan.client.hotrod.RemoteCacheManager.getCache(RemoteCacheManager.java:297)
at org.infinispan.client.hotrod@15.0.11.Final//org.infinispan.client.hotrod.RemoteCacheManager.getCache(RemoteCacheManager.java:261)
at org.jboss.as.clustering.infinispan@35.0.0.Beta1-SNAPSHOT//org.jboss.as.clustering.infinispan.client.ManagedRemoteCacheContainer.getCache(ManagedRemoteCacheContainer.java:78)
at org.jboss.as.clustering.infinispan@35.0.0.Beta1-SNAPSHOT//org.jboss.as.clustering.infinispan.persistence.hotrod.HotRodStore.lambda$addSegments$9(HotRodStore.java:298)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1848)
... 8 more
- links to