Page MenuHomePhabricator

DBPerformance: Expectation readQueryTime <= 5 not met (from ApiQueryUserContribs)
Closed, DuplicatePublicPRODUCTION ERROR

Description

Error
normalized_message
Expectation (readQueryTime <=) 5 by ApiMain::setRequestExpectations not met (actual: {actual}):
{query}
exception.trace
from /srv/mediawiki/php-1.39.0-wmf.19/includes/libs/rdbms/TransactionProfiler.php(468)
#0 /srv/mediawiki/php-1.39.0-wmf.19/includes/libs/rdbms/TransactionProfiler.php(293): Wikimedia\Rdbms\TransactionProfiler->reportExpectationViolated(string, Wikimedia\Rdbms\GeneralizedSql, double, string, string)
#1 /srv/mediawiki/php-1.39.0-wmf.19/includes/libs/rdbms/database/TransactionManager.php(620): Wikimedia\Rdbms\TransactionProfiler->recordQueryCompletion(Wikimedia\Rdbms\GeneralizedSql, double, boolean, integer, string, string)
#2 /srv/mediawiki/php-1.39.0-wmf.19/includes/libs/rdbms/database/Database.php(1585): Wikimedia\Rdbms\TransactionManager->recordQueryCompletion(Wikimedia\Rdbms\GeneralizedSql, double, boolean, integer, string)
#3 /srv/mediawiki/php-1.39.0-wmf.19/includes/libs/rdbms/database/Database.php(1404): Wikimedia\Rdbms\Database->attemptQuery(array, array, string, string, boolean, boolean)
#4 /srv/mediawiki/php-1.39.0-wmf.19/includes/libs/rdbms/database/Database.php(1236): Wikimedia\Rdbms\Database->executeQuery(string, string, integer, string)
#5 /srv/mediawiki/php-1.39.0-wmf.19/includes/libs/rdbms/database/Database.php(2004): Wikimedia\Rdbms\Database->query(string, string, integer)
#6 /srv/mediawiki/php-1.39.0-wmf.19/includes/libs/rdbms/querybuilder/SelectQueryBuilder.php(641): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
#7 /srv/mediawiki/php-1.39.0-wmf.19/includes/api/ApiQueryBase.php(427): Wikimedia\Rdbms\SelectQueryBuilder->fetchResultSet()
#8 /srv/mediawiki/php-1.39.0-wmf.19/includes/api/ApiQueryUserContribs.php(343): ApiQueryBase->select(string, array, array)
#9 /srv/mediawiki/php-1.39.0-wmf.19/includes/api/ApiQuery.php(657): ApiQueryUserContribs->execute()
#10 /srv/mediawiki/php-1.39.0-wmf.19/includes/api/ApiMain.php(1901): ApiQuery->execute()
#11 /srv/mediawiki/php-1.39.0-wmf.19/includes/api/ApiMain.php(875): ApiMain->executeAction()
#12 /srv/mediawiki/php-1.39.0-wmf.19/includes/api/ApiMain.php(846): ApiMain->executeActionWithErrorHandling()
#13 /srv/mediawiki/php-1.39.0-wmf.19/api.php(90): ApiMain->execute()
#14 /srv/mediawiki/php-1.39.0-wmf.19/api.php(45): wfApiMain()
#15 /srv/mediawiki/w/api.php(3): require(string)
#16 {main}
Impact
Notes

Logging in passing on behalf of @Tamzin — I can replicate but I've not done any digging as it's late here 😅

Details

Request URL
https://en.wikipedia.org/w/api.php?format=*&action=query&list=*&uclimit=*&ucuser=*&ucprop=*

Event Timeline

I think this is due to one of the three users I had in the query being a high-edit-count user (>300k). That would make sense if the DB is applying the limit only after running the whole query, which I gather is how it works? For the purposes of what I'm doing, I can just exclude users with >100k edits, and that ought to handle it. But there's some use cases at least where that wouldn't be an option.

Think I've grabbed the wrong exception above, but this feels a bit like T303010: Query execution timeout for certain Special:Contributions queries?

Also ref T302788

There are some marked differences between these reports, so I could be barking up the wrong tree

Krinkle renamed this task from Expectation (readQueryTime <=) 5 by ApiMain::setRequestExpectations not met (actual: {actual}):{query} to DBPerformance: Expectation readQueryTime <=5 not met (from ApiQueryUserContribs).Jul 11 2022, 11:32 PM
Krinkle renamed this task from DBPerformance: Expectation readQueryTime <=5 not met (from ApiQueryUserContribs) to DBPerformance: Expectation readQueryTime <= 5 not met (from ApiQueryUserContribs).
Krinkle added a project: MediaWiki-Action-API.