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

Calling xwiki.flushCache() causes all wikis to reinitialise

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 15.6-rc-1, 14.10.14, 15.5.1
    • 12.10, 14.4, 14.10
    • Old Core
    • None
    • Unknown
    • N/A
    • N/A

    Description

      How to reproduce:

      • on a farm with multiple wikis
      • start the server, access some wiki (main wiki or subwiki), go through wiki initialisation screen
      • make a script that calls
        xwiki.flushCache()

        or use a script that calls it (for example the Default language updater of the farm tools, see FARMTOOLS-19)

      • access the same wiki that was accessed at step 2

      Expected result:

      • the accessed page loads normally, it may just take a little bit more time as it needs to reload some pages from database instead of cache
      • what's expected from flushCache is that it cleans the document cache, forcing all documents to be reloaded from the database on the next access to them. It's used when there is suspicion that the cache may be corrupted or when it's corrupted on purpose (e.g. in the case of the default language updater of the farm tools it's corrupted on purpose and then 'cleaned').
        • I don't know if it's the case, but it should probably also clean the 'exists' cache.

      Actual result:

      • the "XWiki is initialising... (<percent here>)" screen is displayed before the page is loaded

      According to tmortagne on chat, there may be some unwanted consequences to this 'reinitialisation':

      it's going to init stuff twice because I'm 90% sure all those things I listed are not unregistered when flushcache is called
      For some wiki components it could probably be a problem (as in overwritting prefectly fine components with broken one because their init is blocked by some resource still locked), and for others it's not going to harm much more than a huge pile of warning logs but still annoying

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            lucaa Anca Luca
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: