On Thu, Jan 22, 2009 at 02:48, Matt Kettler <mkettler...@verizon.net> wrote: > Matus UHLAR - fantomas wrote: >> >> On 20.01.09 19:45, Matt Kettler wrote: >> >>> Yes, more specifically, it's mostly going to be updating the "atime", or >>> time of last access, records for tokens. This time is used by the expiry >>> process to drop the least recently used tokens. >>> >> >> What does SA do, if it can't r/w open bayes database? Will it skip BAYES >> checks or just tie it r/o ? >> >> (I notice ocasional missing BAYES in X-Spam headers) >> > Well, first let's be clear.. it's R/W opening the journal, not the > database itself. > > The main _toks and _seen files are only locked R/W if there's one of the > following going on: > learning without bayes_learn_to_journal set > a journal sync > token expiry is running > > As for write locks to the journal, if for some reason there's a > conflict, the update is just dropped with a warning. This isn't > incredibly likely unless your bayes is really busy, as journal updates > are pretty short in nature.
on POSIX filesystems, this should be virtually impossible, since the file is opened for append with atomic writes. --j. > If you look at /lib/Mail/SpamAssassin/BayesStore/DBM.pm and find "sub > cleanup" in it. > > Snippets of that code: > > my $path = $self->_get_journal_filename(); > ... > > if (!open (OUT, ">>".$path)) { > warn "bayes: cannot write to $path, bayes db update ignored: $!\n"; > umask $umask; # reset umask > return; > } > > > >