Page MenuHomePhabricator

Check Wikibase services for expensive setup patterns (db & api calls etc) & fix / remove
Closed, ResolvedPublic

Description

T243725: HtmlPageLinkRendererBeginHookHandler creates a LanguageFallbackChain when it may not be needed highlights one particular issue.
Along with this being fixed other services should also be checked for similar patterns and fixed where needed.
Documentation should be updated to highlight this pattern to be avoided.

Event Timeline

Addshore moved this task from Incoming to Ready to pick up on the Wikidata-Campsite board.

I have some ideas about this but xhgui is down :( https://performance.wikimedia.org/xhgui/ I will try later.

Addshore renamed this task from Check Wikibase services for expensive setup patterns & fix to Check Wikibase services for expensive setup patterns (db & api calls etc) & fix / remove.Jan 30 2020, 9:16 AM

So this taks still needs to look for the same pattern of service construction where one of the things injected into the service ends up doing dB calls or API calls (what was happening with the language fallback chain issue).
Less of a profiling thing and more of a looking by eye thing.
Might be able to do something clever actually where a test replaces the db layer and http call later and calls all of the wikibase repo getters, making sure no http or SQL calls are done.

Change 571318 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Assert service getters never access the DB/ do http requests

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

Change 571318 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Assert service getters never access the DB/ do http requests

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

Change 571474 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Test that factory methods don't access the DB/ do http requests

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

Change 571474 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Test that factory methods don't access the DB/ do http requests

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

We now have fairly conclusive test coverage of this (covers all from-global-state-factory methods I could find), so I think we can consider this done.

Very nice tests for this case :)
We probably also need to do this for the services held withing WikibaseRepo->getWikibaseServices which holds currently another 10 services.

Change 572664 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Make sure WikibaseServices services getters don't access the DB

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

Change 572664 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Make sure WikibaseServices services getters don't access the DB

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

Change 690032 had a related patch set uploaded (by Gergő Tisza; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@master] repo: Mock getLazyConnectionRef

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

Change 690032 merged by Gergő Tisza:

[mediawiki/extensions/Wikibase@master] repo: Mock getLazyConnectionRef

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

Change 689899 had a related patch set uploaded (by Jforrester; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@wmf/1.37.0-wmf.4] repo: Mock getLazyConnectionRef

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

Change 689900 had a related patch set uploaded (by Jforrester; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@wmf/1.37.0-wmf.5] repo: Mock getLazyConnectionRef

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

Change 689899 abandoned by Gergő Tisza:

[mediawiki/extensions/Wikibase@wmf/1.37.0-wmf.4] repo: Mock getLazyConnectionRef

Reason:

needs to be squashed

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

Change 690045 had a related patch set uploaded (by Gergő Tisza; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@master] Backport CI fixes

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

Change 689900 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@wmf/1.37.0-wmf.5] repo: Mock getLazyConnectionRef

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

Change 690045 merged by Gergő Tisza:

[mediawiki/extensions/Wikibase@master] Backport CI fixes

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

Change 690066 had a related patch set uploaded (by Gergő Tisza; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@wmf/1.37.0-wmf.4] Backport CI fixes

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

Change 690066 merged by Gergő Tisza:

[mediawiki/extensions/Wikibase@wmf/1.37.0-wmf.4] Backport CI fixes

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

Change 778627 had a related patch set uploaded (by Umherirrender; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@REL1_36] repo: Mock getLazyConnectionRef

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

Change 778627 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@REL1_36] repo: Mock getLazyConnectionRef

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