Page MenuHomePhabricator

Some articles unavailable due to fatal timeout exception from MathRenderer.php
Open, Needs TriagePublicPRODUCTION ERROR

Description

Trying to get the print version (part 1) of the book Linear Algebra (https://en.wikibooks.org/wiki/Linear_Algebra/Print_version/Part_1)

the system answer with

Internal error.
[XottTApAEJcAAXdr8AkAAACO] 2020-04-06 17:57:28: Fatal exception of type "WMFTimeoutException"

#0 /srv/mediawiki/php-1.35.0-wmf.26/includes/libs/rdbms/database/DatabaseMysqli.php(46): {closure}(integer)
#1 /srv/mediawiki/php-1.35.0-wmf.26/includes/libs/rdbms/database/Database.php(1301): Wikimedia\Rdbms\DatabaseMysqli->doQuery(string)
#2 /srv/mediawiki/php-1.35.0-wmf.26/includes/libs/rdbms/database/Database.php(1219): Wikimedia\Rdbms\Database->executeQueryAttempt(string, string, boolean, string, integer)
#3 /srv/mediawiki/php-1.35.0-wmf.26/includes/libs/rdbms/database/Database.php(1155): Wikimedia\Rdbms\Database->executeQuery(string, string, integer)
#4 /srv/mediawiki/php-1.35.0-wmf.26/includes/libs/rdbms/database/Database.php(1819): Wikimedia\Rdbms\Database->query(string, string)
#5 /srv/mediawiki/php-1.35.0-wmf.26/includes/libs/rdbms/database/Database.php(1915): Wikimedia\Rdbms\Database->select(string, array, array, string, array, array)
#6 /srv/mediawiki/php-1.35.0-wmf.26/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->selectRow(string, array, array, string)
#7 /srv/mediawiki/php-1.35.0-wmf.26/includes/libs/rdbms/database/DBConnRef.php(331): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#8 /srv/mediawiki/php-1.35.0-wmf.26/extensions/Math/src/MathRenderer.php(279): Wikimedia\Rdbms\DBConnRef->selectRow(string, array, array, string)
#9 /srv/mediawiki/php-1.35.0-wmf.26/extensions/Math/src/MathRenderer.php(622): MathRenderer->readFromDatabase()
#10 /srv/mediawiki/php-1.35.0-wmf.26/extensions/Math/src/MathHooks.php(208): MathRenderer->checkTeX()
#11 /srv/mediawiki/php-1.35.0-wmf.26/extensions/Math/src/MathHooks.php(359): MathHooks::mathPostTagHook(MathMathML, Parser)
#12 /srv/mediawiki/php-1.35.0-wmf.26/includes/Hooks.php(174): MathHooks::onParserAfterTidy(Parser, string)
#13 /srv/mediawiki/php-1.35.0-wmf.26/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#14 /srv/mediawiki/php-1.35.0-wmf.26/includes/parser/Parser.php(1621): Hooks::run(string, array)
#15 /srv/mediawiki/php-1.35.0-wmf.26/includes/parser/Parser.php(587): Parser->internalParseHalfParsed(string, boolean, boolean)
#16 /srv/mediawiki/php-1.35.0-wmf.26/includes/content/WikitextContent.php(368): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#17 /srv/mediawiki/php-1.35.0-wmf.26/includes/content/AbstractContent.php(565): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#18 /srv/mediawiki/php-1.35.0-wmf.26/includes/Revision/RenderedRevision.php(267): AbstractContent->getParserOutput(Title, integer, ParserOptions, boolean)
#19 /srv/mediawiki/php-1.35.0-wmf.26/includes/Revision/RenderedRevision.php(236): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#20 /srv/mediawiki/php-1.35.0-wmf.26/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#21 /srv/mediawiki/php-1.35.0-wmf.26/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#22 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#23 /srv/mediawiki/php-1.35.0-wmf.26/includes/Revision/RenderedRevision.php(198): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#24 /srv/mediawiki/php-1.35.0-wmf.26/includes/poolcounter/PoolWorkArticleView.php(196): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#25 /srv/mediawiki/php-1.35.0-wmf.26/includes/poolcounter/PoolCounterWork.php(125): PoolWorkArticleView->doWork()
#26 /srv/mediawiki/php-1.35.0-wmf.26/includes/page/Article.php(787): PoolCounterWork->execute()
#27 /srv/mediawiki/php-1.35.0-wmf.26/includes/actions/ViewAction.php(66): Article->view()
#28 /srv/mediawiki/php-1.35.0-wmf.26/includes/MediaWiki.php(519): ViewAction->show()
#29 /srv/mediawiki/php-1.35.0-wmf.26/includes/MediaWiki.php(305): MediaWiki->performAction(Article, Title)
#30 /srv/mediawiki/php-1.35.0-wmf.26/includes/MediaWiki.php(973): MediaWiki->performRequest()
#31 /srv/mediawiki/php-1.35.0-wmf.26/includes/MediaWiki.php(535): MediaWiki->main()
#32 /srv/mediawiki/php-1.35.0-wmf.26/index.php(47): MediaWiki->run()
#33 /srv/mediawiki/w/index.php(3): require(string)
#34 {main}

Details

Request ID
XottTApAEJcAAXdr8AkAAACO

Event Timeline

Aklapper changed the subtype of this task from "Task" to "Production Error".Apr 6 2020, 6:51 PM

Hi @Superbarbapapa1966, thanks for taking the time to report this and welcome to Wikimedia Phabricator!

Aklapper renamed this task from BUG - Linear Algebra - Part 1 print version - DOESN'T WORK to Fatal exception of type "WMFTimeoutException" on https://en.wikibooks.org/wiki/Linear_Algebra/Print_version/Part_1.Apr 6 2020, 6:53 PM
Aklapper set Request ID to XottTApAEJcAAXdr8AkAAACO.
Aklapper added a project: Performance Issue.
Aklapper edited Stack Trace. (Show Details)
Aklapper set Phatality ID to 5e7d2fda2aeafbd8fcca99321e8dbad17d36ba13157376ed7d08a18ac9bb6f75.
RhinosF1 renamed this task from Fatal exception of type "WMFTimeoutException" on https://en.wikibooks.org/wiki/Linear_Algebra/Print_version/Part_1 to BUG - Linear Algebra - Part 1 print version - DOESN'T WORK.Apr 6 2020, 6:53 PM
RhinosF1 set Request URL to https://en.wikibooks.org/wiki/Linear_Algebra/Print_version/Part_1.
RhinosF1 edited Stack Trace. (Show Details)
RhinosF1 removed Phatality ID.
Aklapper renamed this task from BUG - Linear Algebra - Part 1 print version - DOESN'T WORK to Fatal exception of type "WMFTimeoutException" on https://en.wikibooks.org/wiki/Linear_Algebra/Print_version/Part_1.Apr 6 2020, 6:53 PM
Aklapper removed Request URL.
Aklapper edited Stack Trace. (Show Details)
Aklapper set Phatality ID to 5e7d2fda2aeafbd8fcca99321e8dbad17d36ba13157376ed7d08a18ac9bb6f75.

This is from MathRenderer::readFromDatabase(), doing:

$rpage = $dbr->selectRow( $this->getMathTableName(),
				$this->dbInArray(),
				[ 'math_inputhash' => $this->getInputHash() ],
				__METHOD__ );

AS far as I understand the code, it tries to fetch an already rendered version of the formula based on a hash. This should be a primary key lookup. I'm not sure what could cause the database to time out on this. Maybe DBA have an idea?

Indeed. But usually it should use restbase in production...maybe (disableTexFilter)[https://github.com/wikimedia/mediawiki-extensions-Math/blob/864340c4505d6c3047010dde582cf0667da3c09d/extension.json#L92] is configured differently in wikiversity.

Still seen. It seems we encounter about 10-30 articles a day on the backend that we are unable to render due to a timeout exception from a stack trace involving MathRenderer.php.

https://logstash.wikimedia.org/goto/b24e430b6fa9a8aa33276305d642d2af

These could be flukes where something else just before Math takes a long time but just short enough not to time out and then Math is victim of the execution timeout being reached, or it could mean this code path is too slow and may need some kind of complexity or time-spent budget so that they are more detrministic for editors and have a better fallback.

For example, SyntaxHighlight and Score extensions tend to fallback and allow the rest of the article to still render, but Math currently causes the article to be unavailable and uncached.

Krinkle renamed this task from Fatal exception of type "WMFTimeoutException" on https://en.wikibooks.org/wiki/Linear_Algebra/Print_version/Part_1 to Some articles unavailable due to fatal timeout exception from MathRenderer.php.Jul 12 2021, 7:06 PM