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

Alexia created this task.Mar 15 2018, 3:38 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 15 2018, 3:38 PM

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 closed this task as Resolved.Mar 16 2018, 12:11 PM
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