SA Bugzilla – Bug 5999
`sa-learn --force-expire` fails with 'token_expiration: SQL error: Deadlock found when trying to get lock; try restarting transaction'
Last modified: 2022-04-15 08:23:50 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?
*** Bug 5654 has been marked as a duplicate of this bug. ***
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 ***