• File contention for bayes database prevents checking

    By Nick Radov 2 decades ago

    The agent "SpamAssassin\Check Mail server (Windows/32)" intermittently fails with this error.



    02/15/2006 04:04:06 PM Router: Agent printing: MLNGRUNSPAMASSASSINWSH::SpamAssassin: [7788] warn: bayes: cannot open bayes databases C:\Documents and Settings\Default User/.spamassassin/bayes_ R/W: lock failed: File exists

    (1) at line 29

    02/15/2006 04:04:08 PM Router: Agent printing: GCHECKDOCUMENT::SpamAssassin: [7788] warn: bayes: cannot open bayes databases C:\Documents and Settings\Default User/.spamassassin/bayes_
    R/W: lock failed: File exists

    (1) at line 66



    I suspect that is happening when multiple Router threads happen to run SpamAssassin at the same time and they try to lock the same file. We should add a check for that specific error message, and if it happens then just try again.



    This bug could also be worked around by using spamd and storing the bayes database in NotesSQL, but that will take a lot more work.