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

XWikiDocuments not thread safe added to XWikiCacheStore

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • 2.7.2, 8.2.1
    • Old Core
    • Unknown

    Description

      XWikiDocument class is not thread safe. Thus XWikiDocument objects created and loaded without any synchronisation in loadXWikiDoc XWikiHibernateStore lack memory visibility guaranties. These objects are added to the XWikiCacheStore (normally Jboss implementation) again without any synchronization. Hence the XWikiDocument object which is possibly incompletely written to the main memory, is publish to multiple threads by adding to the cache (e.g. jbosscache). All threads running on a different cpu core (multicore architecture) may see an incomplete version of the loaded XWikiDocument object.

      There is a junit test proving the broken multi core multi-threaded situation:
      ConcurrentCacheTest.java
      test_multiThreaded_scenario1 will fail on a multi core architecture. Yet, test_multiRuns_singleThreaded_scenario1 succeeds and shows that the test implementation is correct.

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              fpichler Fabian Pichler
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: