SA Bugzilla – Bug 1611
Bayes only ever expires once?
Last modified: 2003-03-13 10:59:34 UTC
Unless I'm reading the code wrong, a scan() will call expiry_due() to see if an expire run needs to happen. It looks at the ntokens entry in the database, and if runs if ntokens > min_size (which doesn't make any sense since we'd expire back to min_size, and we'd then start expiring every scan()), it'll expire. However, ntokens only ever gets updated when an expire is done. So an expire never actually occurs unless it's forced. Or am I missing something? My suggested change would be to make tok_put: sub tok_put { my ($self, $tok, $ts, $th, $atime) = @_; $ts ||= 0; $th ||= 0; if ($ts == 0 && $th == 0) { delete $self->{db_toks}->{$tok}; $self->{db_toks}->{$NTOKENS_MAGIC_TOKEN}--; } else { if ( !exists $self->{db_toks}->{$tok} ) { $self->{db_toks}->{$NTOKENS_MAGIC_TOKEN}++; } $self->{db_toks}->{$tok} = tok_pack ($ts, $th, $atime); } } I added the sections for $NTOKENS_MAGIC_TOKEN. Thoughts? I'd do up a suggested patch, but I have to head out to a doctor's appointment. :|
*** Bug 1555 has been marked as a duplicate of this bug. ***
I filed this as bug 1555 but no one said anything. Marked 1555 as dup of this.
Subject: Re: Bayes only ever expires once? On Thu, Mar 06, 2003 at 12:44:24PM -0800, bugzilla-daemon@hughes-family.org wrote: > I filed this as bug 1555 but no one said anything. > > Marked 1555 as dup of this. huh! I was looking for "bayes" in the summary, so I didn't see your bug. Thanks for noticing this! I see your code is much the same as mine except you do an extra check (good thing). I'll put it in 2.60 shortly and put up a 2.50 patch for consideration shortly. :)
Subject: Re: [SAdev] New: Bayes only ever expires once? > I added the sections for $NTOKENS_MAGIC_TOKEN. Thoughts? I'd do up a sugge > sted patch, but I have to head out to a doctor's appointment. :| yes, it makes sense. (ps: doh ;)
Created attachment 729 [details] suggested patch for 2.50
reassigning to malte. :)
committed to 2.5 branch. closing bug.