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

Race condition in XWiki cache store can lead to existing documents reported as not-existing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 17.10.0
    • Old Core
    • None
    • Unknown

    Description

      There are no real steps to reproduce as this is a race condition that is most likely very hard to reproduce but that might have caused integration test failures due to XWiki.XWikiServerClass being reported as missing (just a theory, not confirmed). What is confirmed is that the following could in theory happen in XWikiCacheStore:

      Thread A calls store.exists(XWiki.XWikiServerClass)false (not created yet in the database).
      Thread B runs the mandatory document initializer and saves the class: {{invalidateCache(key)}}removes both the exists and the actual page entry under the write lock.
      Thread A calls pageExistCache.set(key, FALSE), storing that the page doesn't exist in the cache.

      The timing looks implausible and can probably only reproduced under a specific load pattern. Still, it's a cache correctness bug that can have the consequence that a freshly created document is reported as non-existing. The lifetime of the cache is infinite, but further invalidation or a full cache can remove the invalid entry again.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: