Bug 1888 - Bayes db v2 will not expire
Summary: Bayes db v2 will not expire
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Learner (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: PC Linux
: P5 normal
Target Milestone: 2.60
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-10 07:39 UTC by Graham Murray
Modified: 2003-05-10 09:29 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Murray 2003-05-10 07:39:21 UTC
On converting from v1 to v2 db, I have over 185000 tokens, so tried to manually
expire. This failed with illegal divide by zero on line 516 of BayesStore.pm.
This is because $magic[9] is 0. In line 502, there is a test which only sets
$newdelta is $magic[9] > 0, which indicates that 0 is an acceptable value for
this token.
Comment 1 Theo Van Dinter 2003-05-10 17:29:43 UTC
doh!

yeah, 0 is a valid number.  it shouldn't happen in actual usage after an expire
has run, but it's definately the value until the first expire runs.

I've added check to make sure that the value is greater than 0.  This will make
the $ratio variable == 0 which is fine.  It's used to figure out if the last
expire count and the current goal expire count are wildly different (ie: the
last expire expired 100k tokens, but now we want to expire 20k tokens).  If
they're different enough (>50%) the expire system will figure there was a wierd
surge and it should recompute the appropriate expiry atime.

fix committed. :)  I also found a few other bugs that I fixed as well.