[infinispan-issues] [JBoss JIRA] (ISPN-3528) CacheLoaderInterceptor.visitEntrySetCommand can hang
Dan Berindei (JIRA)
jira-events at lists.jboss.org
Thu Sep 19 09:56:04 EDT 2013
Dan Berindei created ISPN-3528:
----------------------------------
Summary: CacheLoaderInterceptor.visitEntrySetCommand can hang
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
More information about the infinispan-issues
mailing list