Closed Bug 909278 Opened 7 years ago Closed 7 years ago

deadlocks setting last_activity_ts (Deadlock found when trying to get lock; try restarting transaction [for Statement "UPDATE profiles SET last_activity_ts = ? WHERE userid = ?"])

Categories

(bugzilla.mozilla.org :: Extensions, defect)

Production
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: glob, Assigned: glob)

References

Details

Attachments

(1 file)

part of the userprofile extension involves touching last_activity_ts when a user touches a bug.

i've noticed a few deadlocks as a result of this:

DBD::mysql::db do failed: Deadlock found when trying to get lock; try restarting transaction [for Statement "UPDATE profiles SET last_activity_ts = ? WHERE userid = ?"] (Bugzilla/Object.pm:442)

one way of fixing this may be to commit the changes to the profile outside of the main transaction block, as small transactions are less prone to collision.
Attached patch 909278_1.patchSplinter Review
Attachment #795388 - Flags: review?(dkl)
Comment on attachment 795388 [details] [diff] [review]
909278_1.patch

Review of attachment 795388 [details] [diff] [review]:
-----------------------------------------------------------------

Works good. r=dkl
Attachment #795388 - Flags: review?(dkl) → review+
Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bmo/4.2/
modified Bugzilla/Bug.pm
modified extensions/UserProfile/Extension.pm
Committed revision 8971.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Thank you; I'd seen the odd deadlock when using TBPL (tbplbot etc). Will keep an eye out for any more, and if needed I guess we can always exempt tbplbot like we do for the first patch extension.
tbplbot is still colliding, quite frequently.
Spoken to glob about this on IRC - we need timestamps, a copy of the error shown in TBPL (ie what BzAPI returns) and also whether the comment actually ended up in the bug. When we have that please file as a new bug marked blocking this one - cheers! :-)
Blocks: 912564
Component: Extensions: UserProfile → Extensions
You need to log in before you can comment on or make changes to this bug.