random oddities and questions
David Relson
relson at osagesoftware.com
Tue Oct 8 13:35:49 CEST 2002
At 01:52 AM 10/8/02, Eric Seppanen wrote:
>What is populate_stats() for? It's not called anywhere.
It's the internal loop of select_indicators(). At one time
select_indicators() was factored into a couple of component
functions. This has been undone - possibly it was undone in the switch
from Judy arrays to word hashes. Anyhow, I'll delete the function.
>Is there a reason we no longer print the top "interesting" words? This is
>the single most useful debugging tool in there. It used to appear at
>verbose >= 1 . Presumably the correct action is to add
> if (verbose) print_stats(stats);
>after select_indicators() is called.
There's a timing issue here, i.e. where in the header do you want to print
these statistics. In my personal copy of bogostats, I call print_stats()
right after printing the "X-Bogosity" message. Don't forget that it _does_
print 15 lines of statistics which significantly adds to the number of
header lines and which can be distracting. FWIW, my code calls it only for
spam - probably ought to be an option.
>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.
Perhaps some of the stdout stuff should be removed, or turned off.
>Multiple wordlists are sort-of working now in my directory. Just gotta
>figure out why the locking code doesn't lock all the lists.
To ask the simple question, are you setting the active flags and using the
lock_list functions? You might want to forward a code diff to Gyepi so he
can look at how you're using locks.
>I notice that open_wordlist() is being called outside the locking. Is
>that bad? I don't know if db_open() and db_init() are doing anything that
>needs locking. I almost think that locking should take place before
>touching the files at all; an open db handle is an invitation to touch the
>database.
Seems to me that one needs a handle before one can lock a database. The
call to db_open() gets the handle. I suppose it would be possible for
bogofilter to have a single "bogofilter-lock" rather than use database
locking. I don't think it'd be a good thing.
More information about the bogofilter-dev
mailing list