database is locked(5) at dbdimp.c line 402
Julian Field
MailScanner at ecs.soton.ac.uk
Mon Oct 27 13:37:25 GMT 2008
I find I only get that error when the database file is corrupt. Deleting
the SpamAssassin cache file in /var/spool/MailScanner/incoming always
fixed it for me.
Jules.
Eduardo Casarero wrote:
>
>
> 2008/10/23 Alvaro Marín <alvaro at hostalia.com <mailto:alvaro at hostalia.com>>
>
> Hello,
>
> I'm getting this error continuosly when the server's load is high:
>
> MailScanner[29045]: database is locked(5) at dbdimp.c line 402
>
> and the message scanning slows a lot.
>
> I see that:
>
> # grep timeout .cpan/build/DBD-SQLite-1.14-hR9dHa/dbdimp.h -i
> /* 30 second timeout by default */
> #define SQL_TIMEOUT 30000
>
> the timeout is 30secs by default in SQLite, perhaps too high (I prefer
> scan the message again instead of wait 30secs).
>
> So I've modified MailScanner's SA.pm and added:
>
> $MailScanner::SA::cachedbh->func( "2000", 'busy_timeout');
>
> to set it to 2 seconds, after the connection to the cache db:
>
> $MailScanner::SA::cachedbh = DBI->connect(
>
> "dbi:SQLite:$MailScanner::SA::cachefilename",
>
> "","",{PrintError=>0,InactiveDestroy=>1});
>
>
> I've tested it and it seems that works fine; is this a safe way to do
> this? Perhaps recompile SQLite changing that value is better?
>
> Regards,
>
>
> Do you have the SA-cache on tmpfs? mounting in tmpfs should be fast
> enough to keep happy MS.
>
> Regards,
>
> Eduardo.
>
>
>
> --
> Alvaro Marín Illera
> Hostalia Internet
> www.hostalia.com <http://www.hostalia.com>
>
> --
> MailScanner mailing list
> mailscanner at lists.mailscanner.info
> <mailto:mailscanner at lists.mailscanner.info>
> http://lists.mailscanner.info/mailman/listinfo/mailscanner
>
> Before posting, read http://wiki.mailscanner.info/posting
>
> Support MailScanner development - buy the book off the website!
>
>
Jules
--
Julian Field MEng CITP CEng
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
Need help customising MailScanner?
Contact me!
Need help fixing or optimising your systems?
Contact me!
Need help getting you started solving new requirements from your boss?
Contact me!
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the MailScanner
mailing list