[MediaWiki-commits] [Gerrit] mediawiki...Math[master]: Better error handling for math render errors
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/353056 ) Change subject: Better error handling for math render errors .. Better error handling for math render errors So far, rare render errors caused by blips in the network or the mathoid service produce a big red warning in the page, and cause a tracking category to be added. The rendered content along with the error message is cached normally, which means that temporary errors are persisted indefinitely. As a consequence, editors need to periodically perform null edits to remove temporary render errors from caches. T136812 documents a history of this. This patch aims to improve error handling through two changes: 1) Limit caching of rendered content to 10 minutes. As a consequence, temporary render errors should clear themselves up fairly quickly, eliminating the need for manual follow-up. The 10 minute timeout was chose as a compromise between relatively timely cleanup, and limited load from re-renders after math trouble. 2) Track render errors in a dedicated category. This avoids mixing syntax errors with temporary render errors, which should make cleanup efforts a lot simpler. Bug: T136812 Change-Id: If7537ed9117fb736a09f4396b7d55d774ce9674f --- M Math.hooks.php 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Mobrovac: Looks good to me, approved jenkins-bot: Verified diff --git a/Math.hooks.php b/Math.hooks.php index 2950b66..223b80e 100644 --- a/Math.hooks.php +++ b/Math.hooks.php @@ -229,7 +229,11 @@ } else { LoggerFactory::getInstance( 'Math' )->warning( "Rendering failed. Printing error message." ); - $parser->addTrackingCategory( 'math-tracking-category-error' ); + // Set a short parser cache time (10 minutes) after encountering + // render issues, but not syntax issues. + $parser->getOutput()->updateCacheExpiry( 600 ); + // Add a tracking category specialized on render errors. + $parser->addTrackingCategory( 'math-tracking-category-render-error' ); return $renderer->getLastError(); } Hooks::run( 'MathFormulaPostRender', -- To view, visit https://gerrit.wikimedia.org/r/353056 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7537ed9117fb736a09f4396b7d55d774ce9674f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Math Gerrit-Branch: master Gerrit-Owner: GWickeGerrit-Reviewer: GWicke Gerrit-Reviewer: Mobrovac Gerrit-Reviewer: Physikerwelt Gerrit-Reviewer: Ppchelko Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Math[master]: Better error handling for math render errors
GWicke has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/353056 ) Change subject: Better error handling for math render errors .. Better error handling for math render errors So far, rare render errors caused by blips in the network or the mathoid service produce a big red warning in the page, and cause a tracking category to be added. The rendered content along with the error message is cached normally, which means that temporary errors are persisted indefinitely. As a consequence, editors need to periodically perform null edits to remove temporary render errors from caches. T136812 documents a history of this. This patch aims to improve error handling through two changes: 1) Limit caching of rendered content to 10 minutes. As a consequence, temporary render errors should clear themselves up fairly quickly, eliminating the need for manual follow-up. The 10 minute timeout was chose as a compromise between relatively timely cleanup, and limited load from re-renders after math trouble. 2) Track render errors in a dedicated category. This avoids mixing syntax errors with temporary render errors, which should make cleanup efforts a lot simpler. Change-Id: If7537ed9117fb736a09f4396b7d55d774ce9674f --- M Math.hooks.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math refs/changes/56/353056/1 diff --git a/Math.hooks.php b/Math.hooks.php index 2950b66..223b80e 100644 --- a/Math.hooks.php +++ b/Math.hooks.php @@ -229,7 +229,11 @@ } else { LoggerFactory::getInstance( 'Math' )->warning( "Rendering failed. Printing error message." ); - $parser->addTrackingCategory( 'math-tracking-category-error' ); + // Set a short parser cache time (10 minutes) after encountering + // render issues, but not syntax issues. + $parser->getOutput()->updateCacheExpiry( 600 ); + // Add a tracking category specialized on render errors. + $parser->addTrackingCategory( 'math-tracking-category-render-error' ); return $renderer->getLastError(); } Hooks::run( 'MathFormulaPostRender', -- To view, visit https://gerrit.wikimedia.org/r/353056 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7537ed9117fb736a09f4396b7d55d774ce9674f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Math Gerrit-Branch: master Gerrit-Owner: GWicke___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits