Page MenuHomePhabricator

XCache used as ObjectCache even if variable storage is disabled
Closed, ResolvedPublic

Description

Author: john

Description:
Patch to check xcache.var_size

Right now if $wgMainCacheType (Or any of the caches) are set to CACHE_ACCEL, it only checks if the function exists. In some cases where XCache is installed however variable storage is off (xcache.var_size = 0), MediaWiki will continue to blindly try and use XCache, resulting in a slew of warnings such as this:

Warning: xcache_get(): xcache.var_size is either 0 or too small to enable var data caching in /customers/d/b/e/hugsmile.eu/httpd.www/mediawiki-1.17.0/includes/BagOStuff.php on line 619

We should probably not continue using it if there's alternatives or just plain notify the site owner that his caching method isn't working. At the least, checking for this at install time should be done. The included patch does both.


Version: 1.17.x
Severity: minor

attachment xcacheFix.patch ignored as obsolete

Details

Reference
bz30131

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 21 2014, 11:57 PM
bzimport set Reference to bz30131.
bzimport added a subscriber: Unknown Object (MLST).

john wrote:

Reattached marked as a patch so bugzilla recognizes it

Attached:

Looks good -- did a quick test on Ubuntu 11.04 w/ php5-xcache module enabled.

Default config of that package actually has the xcache.var_size set to 0, so that's a good thing to check for! With patch in, this condition gets treated as if xcache just wasn't there, which seems like the right behavior. When the xcache.var_size is cranked up (say 32M), it's still detected.

Note for potential testers: the installer does detection near the beginning. To ensure that it's seeing your PHP configuration updates, restart the install after each config + Apache restart.

Applied on trunk in r93563.

Recommending for backport to 1.18 and 1.17; marking in CR.

Took the liberty of doing it for 1.18 in r93564.