Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-6276

Non-threadsafe use of HashSet in AdvancedAsyncCacheLoader

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 6.0.2.Final
    • Loaders and Stores
    • None

      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.

              slaskawi@redhat.com Sebastian Ɓaskawiec (Inactive)
              rhn-support-dereed Dennis Reed
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: