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: NEW
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:
Depends on:
Blocks:
 
Reported: 2008-10-16 07:41 UTC by Bernd Petrovitsch
Modified: 2008-10-16 07:41 UTC (History)
0 users



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?