Opened on 08/18/2015 at 04:51:52 PM

Closed on 12/29/2016 at 09:55:25 AM

#2924 closed defect (fixed)

[trac] Avoid deadlock in DB cleanup cronjobs

Reported by: matze Assignee: ferris
Priority: P3 Milestone:
Module: Infrastructure Keywords:
Cc: fhd, fred Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29369504
https://codereview.adblockplus.org/29369517

Description

Subject: Cron <trac@issues1> mysql -utrac -p'O7780D8nFJl2onW' 
trac_orders --execute ' INSERT INTO session_attribute (sid, 
authenticated, name, value) SELECT sid, authenticated, name, value FROM 
trac.session_attribute WHERE authenticated = 1 AND name IN ("email", 
"password") ON DUPLICATE KEY UPDATE value=VALUES(value) ' >/dev/null
Date: Tue, 18 Aug 2015 02:00:01 +0000 (UTC)
From: Cron Daemon <***@adblockplus.org>
To: ***@adblockplus.org

ERROR 1213 (40001) at line 1: Deadlock found when trying to get lock; try restarting transaction

Attachments (0)

Change History (7)

comment:1 Changed on 12/22/2016 at 10:54:21 AM by ferris

  • Owner set to ferris
  • Review URL(s) modified (diff)

comment:2 Changed on 12/22/2016 at 10:56:27 AM by ferris

We've landed the related commit: https://hg.adblockplus.org/infrastructure/rev/cd9c254fe4c7

Rolling it out on issues1 now and we'll see over time if the cron job runs more stable.

comment:3 Changed on 12/22/2016 at 09:10:58 PM by ferris

  • Summary changed from Avoid deadlock in Trac cleanup queries to [trac] Avoid deadlock in DB cleanup cronjobs

comment:4 Changed on 12/23/2016 at 10:52:24 PM by ferris

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

It seems that the other cron-job collides as well. Just added a second patch: https://codereview.adblockplus.org/29369517

I've manually applied the change in the issues1 cronjobs for now to see how they run over the holidays. Obviously, it's not critical if these cronjobs fail now and then.

Last edited on 12/23/2016 at 10:53:00 PM by ferris

comment:5 Changed on 12/27/2016 at 07:07:28 AM by ferris

Looking good, no more complaints from this cronjob the last days. I suggest we close this ticket as soon as we've got the second review done, and the changes properly synced to issues1.

comment:6 Changed on 12/29/2016 at 09:45:22 AM by abpbot

A commit referencing this issue has landed:
Issue 2924 - Move session cleanup to not collide with sync

comment:7 Changed on 12/29/2016 at 09:55:25 AM by ferris

  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from ferris.
 
Note: See TracTickets for help on using tickets.