[infinispan-issues] [JBoss JIRA] (ISPN-6276) Non-threadsafe use of HashSet in AdvancedAsyncCacheLoader

Dennis Reed (JIRA) issues at jboss.org
Thu Feb 25 22:09:00 EST 2016


Dennis Reed created ISPN-6276:
---------------------------------

             Summary:  Non-threadsafe use of HashSet in AdvancedAsyncCacheLoader
                 Key: ISPN-6276
                 URL: https://issues.jboss.org/browse/ISPN-6276
             Project: Infinispan
          Issue Type: Bug
          Components: Loaders and Stores
    Affects Versions: 6.0.2.Final
            Reporter: Dennis Reed


org.infinispan.persistence.async.AdvancedAsyncCacheLoader$process creates a HashSet, and passes it to loadAllKeys().

loadAllKeys() creates a task to get each key and add it to the HashSet.
This task is run by org.infinispan.persistence.file.SingleFileStore#process, which runs it in multiple threads at once (one thread per key).

There is no synchronization on that HashSet that is shared by the multiple threads.

HashSet is not thread safe.  One known side effect of non-synchronized access by multiple threads is infinite loops, which has been witnessed here.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the infinispan-issues mailing list