Page MenuHomePhabricator

DatabaseBase::deadlockLoop: Transaction already in progress (from RefreshLinks::fixLinksFromArticle)
Closed, ResolvedPublic

Description

when running refreshLinks maintenance script, i get spammed with deadlockLoop notices:

Notice: DatabaseBase::deadlockLoop: Transaction already in progress (from RefreshLinks::fixLinksFromArticle), performing implicit commit! [Called from DatabaseBase::begin in /Library/WebServer/Documents/php-master/includes/db/Database.php at line 3340] in /Library/WebServer/Documents/php-master/includes/debug/MWDebug.php on line 302

Call Stack:

 0.0008     749792   1. {main}() /Library/WebServer/Documents/php-master/maintenance/refreshLinks.php:0
 0.0027    1291520   2. require_once('/Library/WebServer/Documents/php-master/maintenance/doMaintenance.php') /Library/WebServer/Documents/php-master/maintenance/refreshLinks.php:321
 0.0944   20580024   3. RefreshLinks->execute() /Library/WebServer/Documents/php-master/maintenance/doMaintenance.php:101
 0.0945   20580816   4. RefreshLinks->doRefreshLinks() /Library/WebServer/Documents/php-master/maintenance/refreshLinks.php:53
22.8758   59445904   5. RefreshLinks::fixLinksFromArticle() /Library/WebServer/Documents/php-master/maintenance/refreshLinks.php:173
22.9135   59498888   6. DataUpdate::runUpdates() /Library/WebServer/Documents/php-master/maintenance/refreshLinks.php:247
22.9221   59513064   7. Wikibase\Updates\DataUpdateAdapter->doUpdate() /Library/WebServer/Documents/php-master/includes/deferred/DataUpdate.php:101
22.9221   59513112   8. call_user_func_array:{/Library/WebServer/Documents/php-master/extensions/WikidataBuild/extensions/Wikibase/repo/includes/updates/DataUpdateAdapter.php:70}() /Library/WebServer/Documents/php-master/extensions/WikidataBuild/extensions/Wikibase/repo/includes/updates/DataUpdateAdapter.php:70
22.9221   59513536   9. Wikibase\Repo\Store\SQL\EntityPerPageTable->addEntityPage() /Library/WebServer/Documents/php-master/extensions/WikidataBuild/extensions/Wikibase/repo/includes/updates/DataUpdateAdapter.php:70
22.9221   59513536  10. Wikibase\Repo\Store\SQL\EntityPerPageTable->addRow() /Library/WebServer/Documents/php-master/extensions/WikidataBuild/extensions/Wikibase/repo/includes/store/sql/EntityPerPageTable.php:60
22.9221   59514400  11. Wikibase\Repo\Store\SQL\EntityPerPageTable->addRow_internal() /Library/WebServer/Documents/php-master/extensions/WikidataBuild/extensions/Wikibase/repo/includes/store/sql/EntityPerPageTable.php:104
22.9223   59516312  12. DatabaseBase->deadlockLoop() /Library/WebServer/Documents/php-master/extensions/WikidataBuild/extensions/Wikibase/repo/includes/store/sql/EntityPerPageTable.php:138
22.9223   59516408  13. DatabaseBase->begin() /Library/WebServer/Documents/php-master/includes/db/Database.php:3073
22.9223   59516608  14. wfWarn() /Library/WebServer/Documents/php-master/includes/db/Database.php:3340
22.9223   59516832  15. MWDebug::warning() /Library/WebServer/Documents/php-master/includes/GlobalFunctions.php:1127
22.9224   59520472  16. MWDebug::sendMessage() /Library/WebServer/Documents/php-master/includes/debug/MWDebug.php:157
22.9224   59520832  17. trigger_error() /Library/WebServer/Documents/php-master/includes/debug/MWDebug.php:302

Version: unspecified
Severity: normal
Whiteboard: u=dev c=backend p=0

Details

Reference
bz73456

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 4:00 AM
bzimport set Reference to bz73456.
bzimport added a subscriber: Unknown Object (MLST).
aude created this task.Nov 15 2014, 10:15 AM

So, the Wikibase code just needs to check if it's already in a transaction, and not start another if it is...

Change 173491 had a related patch set (by Aude) published:
Use start/endAtomic in Database::deadlockLoop

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

Change 173491 abandoned by Aude:
Use start/endAtomic in Database::deadlockLoop

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

Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).Dec 1 2014, 2:34 PM
demon added a subscriber: demon.Oct 26 2015, 4:36 PM

This has started showing up fairly regularly again.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 26 2015, 4:36 PM
aude added a comment.Oct 26 2015, 4:40 PM

i was running refresh links to populate page_props (page_image) and geo_tags, but maybe we can do this in an alternative way

aude added a comment.Oct 26 2015, 4:41 PM

https://gerrit.wikimedia.org/r/#/c/248061/ is my proposed alternative :) if sensible approach, I can add some tests and we can go with it.

aude added a comment.EditedOct 26 2015, 5:17 PM

wikidatawiki wfLogDBError ERROR: DatabaseBase::deadlockLoop: Transaction already in progress (from RefreshLinks::fixLinksFromArticle), performing implicit commit! {"db_server":"10.64.32.28","db_name":"wikidatawiki","method":"DatabaseBase::begin","fname":"DatabaseBase::deadlockLoop"}

Change 249000 had a related patch set uploaded (by Aude):
Convert refreshLinks to use start/endAtomic

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

Change 249000 merged by jenkins-bot:
Remove begin/commit transaction calls in refreshLinks.php

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

Lydia_Pintscher closed this task as Resolved.Nov 13 2015, 2:41 PM
Lydia_Pintscher claimed this task.

Marking as resolved based on merged patches.