random oddities and questions

Gyepi SAM gyepi at praxis-sw.com
Tue Oct 8 14:11:07 CEST 2002


On Tue, Oct 08, 2002 at 12:52:03AM -0500, Eric Seppanen wrote:

> Are there any remaining objections to logging debug (verbose) data 
> exclusively to stderr?  There's still a heap of stuff going to stdout, 
> which makes a real mess.

Not from me.

> Multiple wordlists are sort-of working now in my directory.  Just gotta 
> figure out why the locking code doesn't lock all the lists.

Locks are only performed on databases whose wordlist nodes that have the 'active' flag set.
This allows you to operate on a subset of the database handles in the list without having
to change the list.

Usually, you want to set the active flag just before you call db_lock_(reader|writer)_list
You may unset the active flag when you're done, but it is not required.
 
> I notice that open_wordlist() is being called outside the locking.  Is 
> that bad?  

No, since we are only opening the databases.

>I don't know if db_open() and db_init() are doing anything that 
> needs locking.

They shouldn't.

> I almost think that locking should take place before 
> touching the files at all;

Doing so would drop our concurrency to 1: only one instance of bogofilter could be running at a time.
That would be bad.

>an open db handle is an invitation to touch the database.

This is true, but the database interface presumes that a database has been locked when a read/write operation
is performed on it, but does not enforce it, so one *could* do the same operations without locking first.
Since all of our current operations lock first, we should probably enforce it.

If there are no objections, I'll add that.

-Gyepi



More information about the bogofilter-dev mailing list