Steps to replicate the issue (include links if applicable):
- We use the "BiblioPlus" extension, which admittedly is a bit old. However, problem can also exist in other situations.
- Make a page of the following general format:
<cite>[ref1, ref11, ref12, ref2, ref21, ref22, ref3, ref31, ref32, ref4, ref41, ref42, ref5, ref51, ref52, ref6, ref61, ref62, ref7, ref71, ref72, ref8, ref81, ref82, ref9, ref91, ref92, ref10, ref101, ref102]</cite> <math>p_1</math> <math>p_2</math> <math>p_3</math> <math>p_4</math> <math>p_5</math> <math>p_6</math> <math>q_1</math> <math>q_2</math> <math>q_3</math> <math>q_4</math> <math>q_5</math> <math>q_6</math> <math>p_11</math> <math>p_21</math> <math>p_31</math> <math>p_41</math> <math>p_51</math> <math>p_61</math> <math>q_11</math> <math>q_21</math> <math>q_31</math> <math>q_41</math> <math>q_51</math> <math>q_61</math> Some text <biblio> #ref1 #ref2 #ref3 #ref4 #ref5 #ref6 #ref7 #ref8 #ref9 #ref101 #ref11 #ref21 #ref31 #ref41 #ref51 #ref61 #ref71 #ref81 #ref91 #ref11 #ref12 #ref22 #ref32 #ref42 #ref52 #ref62 #ref72 #ref82 #ref92 #ref102 </biblio>
- Save the page
- Open the page
What happens?:
Depending on platform specs, we get Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/public_html/includes/libs/http/MultiHttpClient.php on line 274 or everything works just fine.
I did some digging and the problem is this:
- Every math tag content/string marker gets appended to ParserHooksHandler::$mathLazyRenderBatch
- Then the parsing encounters the biblio tag. This extension parses every refX, thus automatically calling the ParserAfterTidy hook. For every reference!
- The ParserHooksHandler::onParserAfterTidy then does a batchEvaluate on all stored renderers, and then a mathPostTagHook, on all stored math tag thingies. For every call to ParserAfterTidy!
What should have happened instead?:
Math code should be rendered at most once per each inclusion in a page.
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
Math: REL1_39, ab63662f
BiblioPlus: REL1_39, 2d14903
Mediawiki: MediaWiki 1.39.7 (f4addc1)
Other information (browser name/version, screenshots, etc.):