This class in wikibase has lots of code duplication, making it almost impossible to solve T169336 properly. This needs to cleaned up so we can inject connections and close them easily.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Replace self-made finally logic with actual "finally" sections | mediawiki/extensions/Wikibase | master | +11 -32 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Ladsgroup | T169336 slow master queries on Wikibase\Client\Usage\Sql\EntityUsageTable::getAffectedRowIds | |||
Invalid | None | T169508 Refactor SqlUsageTracker to reduce code duplication |
Event Timeline
Please describe in much more detail what you mean. I had a quick look at the SqlUsageTracker class, but could not find any obvious code duplication. The class is quite short and does have a bunch of methods that might look similar from a distance, but are all very much distinct.
There are three comments like this:
// NOTE: while logically we'd like the below to be atomic, we don't wrap it in a // transaction to prevent long lock retention during big updates.
The structure below those comments are duplicated several times making it hard to inject proper connections to newUsageTable method.
Change 363097 had a related patch set uploaded (by Thiemo Mättig (WMDE); owner: Thiemo Mättig (WMDE)):
[mediawiki/extensions/Wikibase@master] Replace self-made finally logic with actual "finally" sections
Change 363097 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Replace self-made finally logic with actual "finally" sections
This was created as a blocker for T169336, but since this is resolved it appears the proposed refactoring was not needed.