Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-21662

Don't take the read lock when loading security cache entries

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 15.10
    • Security
    • Unknown

    Description

      When reading entries from the security cache, we're currently always locking the read lock. This is problematic because when the security cache is quite full we'll also frequently insert entries into the security cache which needs a write a lock. As the lock is fair, any write access that is waiting for read accesses to complete, will block all following read accesses. This can lead to a lot of overhead from locking.

      There is a good reason for the write lock for insertion as many internal data structures aren't thread-safe. However, when just getting an entry, these data structures that aren't thread-safe aren't touched and thus it isn't necessary to protect from concurrent modification. It should again be carefully checked that this is indeed the case but it seems likely.

      Attachments

        Activity

          People

            MichaelHamann Michael Hamann
            MichaelHamann Michael Hamann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: