jenkins-bot has submitted this change and it was merged. Change subject: Decline to cache preprocessor items larger than 1 Mb ......................................................................
Decline to cache preprocessor items larger than 1 Mb 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 --- M includes/parser/Preprocessor_Hash.php 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index 8ddb401..9429e44 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -734,8 +734,12 @@ // 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; -- To view, visit https://gerrit.wikimedia.org/r/235650 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idd1acd903193f0753cc5548bd32800705716dd9f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Ori.livneh <o...@wikimedia.org> Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org> Gerrit-Reviewer: Cscott <canan...@wikimedia.org> Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits