HomePhabricator

Resolve circular dependency when invalidating caches

Authored by thiemowmde on May 2 2019, 9:13 AM.

Description

Resolve circular dependency when invalidating caches

I used the tool
https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/tools/dependency-analysis
to find a suprisingly large knot of circular dependencies in this code
repository. In essence: The job LocalJobSubmitJob was previously calling a
service function from CognateRepo, but CognateRepo is the on who creates
the jobs in the first place.

Instead of each job querying it's own list of $sites (= $dbNames) this is
now only done once in CognateRepo (and as a bonus this code is private now).

This change assumes that the list of sites does not change in the short
timespan that passes before the job is executed. I'm not 200% sure this is
true, but I believe so.

Change-Id: I3c01433bef66d167950ea6f76e0b1a6649c77c59

Details