Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-15168

IllegalStateException thrown by commons LRUMap

    XMLWordPrintable

Details

    • Flagged
    • Orion
    • Orion.Cycle7.Sprint1

    Description

      A client got hit by the following IllegalStateException from org.apache.commons.collections4.map.LRUMap, when undergoing a server attack:

      java.lang.IllegalStateException: Entry.next=null, data[removeIndex]=PageCacheKey[<reqInfo>]=true previous=PageCacheKey[<reqInfo>]=true key=PageCacheKey[<reqInfo>] value=true size=1000 maxSize=1000 This should not occur if your keys are immutable, and you have used synchronization properly.
      

      The 3 <reqInfo> occurrences above are identical.

      We use this LRUMap in an unsynchronized way at
      org.hippoecm.hst.cache.CompositeHstCache#uncacheableKeys
      and
      org.hippoecm.hst.site.request.CachingObjectConverter.ObjectCache#cache

      The Javadocs of LRUMap says:

      Note that LRUMap is not synchronized and is not thread-safe. If you wish to use this map from multiple threads concurrently, you must use appropriate synchronization. The simplest approach is to wrap this map using Collections.synchronizedMap(Map).
      

      so we can probably improve the product by doing the above.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jhoffman Jeroen Hoffman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: