Page MenuHomePhabricator

$wgExpensiveParserFunctionLimit does not seem to be respected properly
Closed, InvalidPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):
(The steps is too cumbersome to omit here)

What happens?:
$wgExpensiveParserFunctionLimit is set to 500 in CommonSettings.php

https://zh.wikipedia.beta.wmflabs.org/wiki/User:RainBeforeSun/沙盒 is trying to call 933 #ifexist functions.

After more than 500 pages when calling mw.title.new().exists by lua it starts returning error too many expensive function calls: https://zh.wikipedia.beta.wmflabs.org/w/index.php?title=User:RainBeforeSun/沙盒&oldid=22666.

But in the plain wikitext version all #ifexist correctly return true: https://zh.wikipedia.beta.wmflabs.org/w/index.php?title=User:RainBeforeSun/沙盒&oldid=22663.

What should have happened instead?:
Parser should respect $wgExpensiveParserFunctionLimit.

Event Timeline

Func subscribed.

This is by design.
This parser function would try to use the link cache, if it found matches then return early without increasing the counter or checking again.
You added internal links to each page, then the existence was checked and recorded before processing #ifexist.
Note: The cache would be kept for a while, so if you remove links, would not reflect as too many expensive function calls instantly.