[cvs] bogofilter datastore_db.c,1.23,1.24

Gyepi SAM gyepi at praxis-sw.com
Sat Nov 16 22:00:16 CET 2002


On Sat, Nov 16, 2002 at 05:52:50PM +0100, Matthias Andree wrote:
> gyepi at users.sourceforge.net writes:
> > Modified Files:
> > 	datastore_db.c 
> > Log Message:
> > ignore cannot-lock-mmapped-file error for rea-only database
> 
> Isn't this going to break once a writer tries to lock while the
> read-only reader has not yet finished at that time?

No. The files are mmaped with the 'PRIVATE' flag, which means that any changes
to the underlying file will not be seen in the mmaped version, which means that
a writer will acquire the lock and make changes, but those changes will not affect the reader until it closes and reopens the database.

I do, however, see a possible problem with a reader that opens the database
while a writer is making changes:It may get inconsistent data.

I think the correct solution to this locking stuff is not to lock the database file itself but rather to create lock files separate from the database files.

This would also re-simplify the locking stuff.

-Gyepi



More information about the bogofilter-dev mailing list