Bug 5999 - `sa-learn --force-expire` fails with 'token_expiration: SQL error: Deadlock found when trying to get lock; try restarting transaction'
Summary: `sa-learn --force-expire` fails with 'token_expiration: SQL error: Deadlock f...
Status: RESOLVED DUPLICATE of bug 7014
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: 3.2.5
Hardware: Other All
: P5 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
: 5654 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-16 07:41 UTC by Bernd Petrovitsch
Modified: 2022-04-15 08:23 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
A sketchy draft patch to retry a failed DB transaction patch None Bernd Petrovitsch [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Petrovitsch 2008-10-16 07:41:10 UTC
Created attachment 4379 [details]
A sketchy draft patch to retry a failed DB transaction

We use SpamAssassin-3.2.5 via MIMEDefang (via embedded perl). The BayesDB is in a MySQL-5.0.
Since we have 80 MIMEDefang processes running, we disabled auto_expire but expire daily via cron in offline hours.
The `sa-learn --force-expire` fails repeatedly with 'token_expiration: SQL error: Deadlock found when trying to get lock; try restarting transaction'.
Looking into Mail/SpamAssassin/BayesStore.pm and Mail/SpamAssassin/BayesStore/MySQL.pm reveals, that there is no attempt to simply retry the "failed" SQL statement at least a few times at the lowest level.

Is the attached patch (untested, just a sketchy draft, a request-for-comments, ...) the (best) way to go?
Comment 1 Henrik Krohns 2022-04-15 07:04:57 UTC
*** Bug 5654 has been marked as a duplicate of this bug. ***
Comment 2 Henrik Krohns 2022-04-15 08:23:50 UTC
Mostly the same deadlock stuff as Bug 7014 (and Bug 6444 etc), continuing there.

*** This bug has been marked as a duplicate of bug 7014 ***