database is locked(5) at dbdimp.c line 402

--[ UxBoD ]-- uxbod at splatnix.net
Thu Oct 23 15:59:10 IST 2008


Perhaps make it a configuration option ?

Regards,

-- 
--[ UxBoD ]--
// PGP Key: "curl -s http://www.splatnix.net/uxbod.asc | gpg --import"
// Fingerprint: F57A 0CBD DD19 79E9 1FCC A612 CB36 D89D 2C5A 3A84
// Keyserver: www.keyserver.net Key-ID: 0x2C5A3A84
// Phone: +44 845 869 2749

----- "Alvaro Marín" <alvaro at hostalia.com> wrote:

> 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,

-- 
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