[Red Hat JIRA] (ISPN-12420) ConcurrentModificationException for EntryMergePolicyFactoryRegistry
by Dan Berindei (Jira)
[ https://issues.redhat.com/browse/ISPN-12420?page=com.atlassian.jira.plugi... ]
Dan Berindei commented on ISPN-12420:
-------------------------------------
The fact that the collection can be modified during cache startup is a problem in itself: if caches defined in infinispan.xml or persisted in caches.xml do not wait for custom entry merge policies to be deployed before starting, they may not be able to use the custom entry merge policy the user expects them to use.
Looks like all the caches and all the deployed merge policies use on the same {{DeployedMergePolicyFactory}}. But each {{CacheService}} calls {{mergePolicyRegistry.addMergePolicyFactory(this.dependencies.getDeployedMergePolicyRegistry())}} again, modifying the list in {{EntryMergePolicyFactoryRegistry}} while other caches are iterating over it.
I believe {{CacheService}} should not depend on {{DeployedMergePolicyFactoryService}}, instead {{CacheContainerResource}} should depend on {{DeployedMergePolicyFactoryService}} and register the {{DeployedMergePolicyFactory}}.
> ConcurrentModificationException for EntryMergePolicyFactoryRegistry
> -------------------------------------------------------------------
>
> Key: ISPN-12420
> URL: https://issues.redhat.com/browse/ISPN-12420
> Project: Infinispan
> Issue Type: Bug
> Components: Core
> Reporter: Wolf-Dieter Fink
> Priority: Major
>
> The EntryMergePolicyFactoryRegistry createInstance(...) method uses a synchronized collection but did not synchronize the iteration which is imperative from the Java specification, see https://docs.oracle.com/javase/8/docs/api/java/util/Collections.html#sync...
>
>
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
5 years, 2 months