Page MenuHomePhabricator

ChronologyProtector redirect optimization depends on inappropriate $wgLocalVirtualHosts setting
Closed, ResolvedPublic


It seems $wgLocalVirtualHosts doesn't include in wmf-config/CommonSettings.php. The entry was commented out in 2008. And I'm sure there are many other reasons (more non-wikis under

However, aside from Meta-Wiki and Wikimedia Commons, there are no other domains listed. At the very least we should probably include

What does this variable actually do? Two things:

 * Local virtual hosts.
 * This lists domains that are configured as virtual hosts on the same machine.
 * This affects the following:
 * - MWHttpRequest: If a request is to be made to a domain listed here, or any
 *   subdomain thereof, then no proxy will be used.
 *   Command-line scripts are not affected by this setting and will always use
 *   proxy if it is configured.
 * - ChronologyProtector: Decide to shutdown LBFactory asynchronously instead
 *   synchronously if the current response redirects to a local virtual host.
array $wgLocalVirtualHosts

The latter was introduced in a series of commits to both fix bugs with CentralAuth and cross-wiki redirects in some cases, as well as to improve performance in others (no needless blocking).

Given logging in involves redirects and, I guess this might mean this code isn't running as it was intended. We should understand the impact of this not being configured as such, and (if okay) add it.

I also noticed notably absent from the list.

Event Timeline

We should see if there is any unrelated downside to adding login/ I'd imagine it would be useful for account creation on connections with high latency.

It should probably just be so it doesn't include But otherwise this seems mostly like an accidental oversight and not intentional.

Gilles triaged this task as Low priority.
Gilles moved this task from Inbox to Next: Goal-oriented on the Performance-Team board.

Another option is to have the MediaWiki.php code use InterWikiLookup::getAllPrefixes() and the 'iw_url' field for each item.

Looks like using WikiMap is the best choice IMO.

Change 373147 had a related patch set uploaded (by Aaron Schulz; owner: Aaron Schulz):
[mediawiki/core@master] Avoid DB replication waits for farm cross-wiki redirects

Change 373147 merged by jenkins-bot:
[mediawiki/core@master] Avoid preemptive DB replication waits for farm cross-wiki redirects

aaron renamed this task from $wgLocalVirtualHosts should include, and others? to ChronologyProtector redirect optimization depends on inappropriate $wgLocalVirtualHosts setting.Aug 25 2017, 11:24 PM
Krinkle reassigned this task from Krinkle to aaron.
Krinkle moved this task from Blocked (old) to Doing (old) on the Performance-Team board.
Krinkle removed a project: Patch-For-Review.