[
https://issues.jboss.org/browse/ISPN-3528?page=com.atlassian.jira.plugin....
]
William Burns updated ISPN-3528:
--------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
CacheLoaderTask implementation should be thread safe
----------------------------------------------------
Key: ISPN-3528
URL:
https://issues.jboss.org/browse/ISPN-3528
Project: Infinispan
Issue Type: Bug
Components: Locking and Concurrency
Affects Versions: 6.0.0.Alpha4
Reporter: Dan Berindei
Assignee: Mircea Markus
Priority: Critical
Fix For: 6.0.0.Beta2
{{PersistenceManager.processOnAllStores}} receives a {{CacheLoaderTask}} parameter and
calls it on potentially many threads concurrently. So the task object must be
thread-safe.
The {{CacheLoaderTask}}‍s used by
{{CacheLoaderInterceptor.visitEntrySetCommand}}/{{visitKeySetCommand}}/{{visitValuesCommand}}
are not thread-safe. They use a {{HashSet}} without any synchronization, and when accessed
from concurrent threads the map can be corrupted. When this happens, the thread will block
in an infinite loop:
{noformat}
"testng-LocalModeNoPassivationTest" prio=10 tid=0x00007f19141ac800 nid=0x622c
runnable [0x00007f1902a62000]
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.put(HashMap.java:498)
at java.util.HashSet.add(HashSet.java:217)
at java.util.AbstractCollection.addAll(AbstractCollection.java:342)
at
org.infinispan.interceptors.CacheLoaderInterceptor.visitEntrySetCommand(CacheLoaderInterceptor.java:195)
...
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira