Details
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