Page MenuHomePhabricator

Fix User::idFromName() ignoring cache for non-existent users.
Closed, ResolvedPublic

Description

https://gerrit.wikimedia.org/r/#/c/419756/

Fix User::idFromName() ignoring cache for non-existent users.

This fixes a database time out issue where User::idFromName() is repeatedly called from Special:Import due to the user not existing. The response is cached as null, but isset() will return false on a null key. I discovered this issue when trying to import a large XML file through Special:Import. The users for the revisions in the pages did not exist on the destination wiki so hundreds of queries from User:idFromName() were performed and ignoring the self::$idCacheByName cache.

https://i.imgur.com/uuuBoWv.png

Event Timeline

Change 419756 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Alexia):
[mediawiki/core@master] Fix User::idFromName() ignoring cache for non-existent users.

https://gerrit.wikimedia.org/r/419756

thiemowmde assigned this task to Alexia.

Change 419756 merged by jenkins-bot:
[mediawiki/core@master] Fix User::idFromName() ignoring cache for non-existent users.

https://gerrit.wikimedia.org/r/419756