Last modified: 2011-04-30 01:21:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T23161, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21161 - Uploading LocalSettings.php does not always invalidate the file cache
Uploading LocalSettings.php does not always invalidate the file cache
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.15.x
All All
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-16 21:39 UTC by Manfred Krüger
Modified: 2011-04-30 01:21 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch fixing the issue (908 bytes, patch)
2009-10-17 12:04 UTC, Platonides
Details

Description Manfred Krüger 2009-10-16 21:39:41 UTC
I switched off Ajax in LocalSetting.php by using $wgUseAjax = false. Still some pages included the script ajax.js.

The reason for this was the file cache which has not been invalidated by updating LocalSettings.php.

The cause for the problem is the following:
index.php is trying the file cache in line 85:
  if( $cache->isFileCacheGood( /* Assume up to date */ ) ) {

isFileCacheGood in HTMLFileCache.php reacts this way:
  if( !$timestamp ) return true; // should be invalidated on change

Therefore the cached page is used and $wgCacheEpoch is ignored.

The correct code for isFileCacheGood is:
if( !$this->isFileCached() ) return false;
  $cachetime = $this->fileCacheTime();
  if( !$timestamp && ( $wgCacheEpoch <= $cachetime) ) return true; // should be invalidated on change

$good = ...
Comment 1 Platonides 2009-10-17 12:04:16 UTC
Created attachment 6678 [details]
Patch fixing the issue

The if( !$timestamp ) return true; shortcut is intended to avoid having to call filemtime() (on fileCacheTime). Since we need to check the file time to follow $wgCacheEpoch, and the filemtime() value will be cached since we did a file_exists() on the previous line, skip it.
Comment 2 Manfred Krüger 2009-10-18 10:50:49 UTC
Sorry for asking another time. Your patch is exactly the same code as I find in V 1.15.0, so I don't see how it would fix the problem.
Comment 3 Alexandre Emsenhuber [IAlex] 2009-10-21 11:44:13 UTC
Fixed in r57971.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links