Last modified: 2014-11-18 18:07:08 UTC
A hu.wikipedia user reported an "1213: Deadlock found when trying to get lock" SQL error thrown by FlaggedRevision::insertOn when trying to save a page. The reporter is in the 'trusted' group (that is, he has autoreview right but not review). The page he tried to edit was in 'sighted' state.
Does this happen often? Things like that will happen from rarely, but not never, under normal cases.
We had only one report to date. Then again, it has only been a week or two since the FlaggedRevs code update, so - assuming the bug is related to that - it can't be too infrequent if it occured this soon. (At least frequent enough to merit a better error message.)
(In reply to comment #2) > We had only one report to date. Then again, it has only been a week or two > since the FlaggedRevs code update, so - assuming the bug is related to that - > it can't be too infrequent if it occured this soon. (At least frequent enough > to merit a better error message.) Was this with the JavaScript AJAX review form? Previously, those kind of errors were simply not displayed to the user (you just get "action failed" in the title).
(In reply to comment #3) > (In reply to comment #2) > > We had only one report to date. Then again, it has only been a week or two > > since the FlaggedRevs code update, so - assuming the bug is related to that - > > it can't be too infrequent if it occured this soon. (At least frequent enough > > to merit a better error message.) > > Was this with the JavaScript AJAX review form? Previously, those kind of errors > were simply not displayed to the user (you just get "action failed" in the > title). Nevermind, this is about autoreview on edit.
I am running a script using api on dewiki this evening i'll used many times before without any problems. But i got this error three times within 10 minutes. The last one: editing de:Izumi Sakai using api with action=edit&appendtext=... <?xml version="1.0"?><api><error code="internal_api_error_DBQueryError" info="Database query error" xml:space="preserve"> #0 /usr/local/apache/common-local/wmf-deployment/includes/db/Database.php(541): DatabaseBase->reportQueryError('Deadlock found ...', 1213, 'INSERT IGNORE I...', 'FlaggedRevision...', false) #1 /usr/local/apache/common-local/wmf-deployment/includes/db/Database.php(1174): DatabaseBase->query('INSERT IGNORE I...', 'FlaggedRevision...') #2 /usr/local/apache/common-local/wmf-deployment/extensions/FlaggedRevs/FlaggedRevision.php(324): DatabaseBase->insert('flaggedtemplate...', Array, 'FlaggedRevision...', 'IGNORE') #3 /usr/local/apache/common-local/wmf-deployment/extensions/FlaggedRevs/FlaggedRevs.class.php(1353): FlaggedRevision->insertOn(true) #4 /usr/local/apache/common-local/wmf-deployment/extensions/FlaggedRevs/FlaggedRevs.hooks.php(726): FlaggedRevs::autoReviewEdit(Object(Article), Object(User), Object(Revision), NULL) #5 [internal function]: FlaggedRevsHooks::maybeMakeEditReviewed(Object(Article), Object(Revision), false, Object(User)) #6 /usr/local/apache/common-local/wmf-deployment/includes/Hooks.php(133): call_user_func_array(Array, Array) #7 /usr/local/apache/common-local/wmf-deployment/includes/Article.php(1982): wfRunHooks('NewRevisionFrom...', Array) #8 /usr/local/apache/common-local/wmf-deployment/includes/Article.php(1791): Article->doEdit('[[Bild:Entertai...', '+[[fi:Izumi Sak...', 102) #9 /usr/local/apache/common-local/wmf-deployment/includes/EditPage.php(1047): Article->updateArticle('[[Bild:Entertai...', '+[[fi:Izumi Sak...', true, true, false, '') #10 /usr/local/apache/common-local/wmf-deployment/includes/api/ApiEditPage.php(238): EditPage->internalAttemptSave(NULL, false) #11 /usr/local/apache/common-local/wmf-deployment/includes/api/ApiMain.php(595): ApiEditPage->execute() #12 /usr/local/apache/common-local/wmf-deployment/includes/api/ApiMain.php(338): ApiMain->executeAction() #13 /usr/local/apache/common-local/wmf-deployment/includes/api/ApiMain.php(322): ApiMain->executeActionWithErrorHandling() #14 /usr/local/apache/common-local/wmf-deployment/api.php(116): ApiMain->execute() #15 /usr/local/apache/common-local/live-1.5/api.php(3): require('/usr/local/apac...') #16 {main} </error></api>
(In reply to comment #5) > I am running a script using api on dewiki this evening i'll used many times > before without any problems. But i got this error three times within 10 > minutes. How are you using the review API? It might help to know the usage patterns, though these things can be tricky to track either way.
(In reply to comment #6) > (In reply to comment #5) > > I am running a script using api on dewiki this evening i'll used many times > > before without any problems. But i got this error three times within 10 > > minutes. > How are you using the review API? It might help to know the usage patterns, > though these things can be tricky to track either way. Bitten again...edit API, not review. At least that narrows it down to autoReviewEdit() function area.
Tweaked the insertOn() function to be less deadlock prone in r78052. Synced. I'll wait to see if other tweaks are needed.
Is this still occurring often?
Marking closed. r78052 should reduce this, and I haven't heard of new reports (this kind of thing isn't a problem unless it is frequent).
Folding into (a bit) more general bug 28598. *** This bug has been marked as a duplicate of bug 28598 ***