This is a temporarily workaround for T111289. The data ought not be so large,
but it frequently is, and the problem is almost exclusive to this code path.
For now, just avoid attempting to cache the value if its size exceeds a million
bytes.
Bug: T111289
Change-Id: Idd1acd903193f0753cc5548bd32800705716dd9f
// Cache
if ( $cacheable ) {
$cacheValue = sprintf( "%08d", self::CACHE_VERSION ) . serialize( $rootNode );
- $wgMemc->set( $cacheKey, $cacheValue, 86400 );
- wfDebugLog( "Preprocessor", "Saved preprocessor Hash to memcached (key $cacheKey)" );
+
+ // T111289: Cache values should not exceed 1 Mb, but they do.
+ if ( strlen( $cacheValue ) <= 1e6 ) {
+ $wgMemc->set( $cacheKey, $cacheValue, 86400 );
+ wfDebugLog( "Preprocessor", "Saved preprocessor Hash to memcached (key $cacheKey)" );
+ }
}
return $rootNode;