Page MenuHomePhabricator

Avoid database connection in MinervaHooks::onResourceLoaderGetConfigVars
Closed, ResolvedPublic

Description

One in every N requests when this method is called, it seems to acquire a database connection.

This is not ideal in terms of performance (for startup module regeneration), and adds an extra dependency that would be best to avoid for the code to work (quickly) even when e .g. the database might be having issues temporarily.

Screenshot 2019-09-20 at 21.56.37.png (1×2 px, 625 KB)

Event Timeline

From reading T197497, I understand this is mainly to accomodate testing on wikis that are more or less permanently in read-only mode. It doesn't need to-the-minute live status from current databases to reflect temporary read-only mode induced by a lagged DB replica or other maintenance. (These would currently end up cached for 5-10 min and affect users much longer than needed.)

I'll switch it to a static configuration check then.

Change 538333 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/skins/MinervaNeue@master] Use cheaper ConfiguredReadOnlyMode instead of live Database check

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

Change 538333 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Use cheaper ConfiguredReadOnlyMode instead of live Database check

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

Krinkle claimed this task.

Change 539008 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[operations/mediawiki-config@master] Bug: T233458

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