Bug 6029 - sa-learn launches rebuild_learner_caches() in verbose mode, which results in lots of "synced databases from journal" messages
Summary: sa-learn launches rebuild_learner_caches() in verbose mode, which results in ...
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Learner (show other bugs)
Version: 3.2.5
Hardware: Other All
: P5 enhancement
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-13 00:45 UTC by Yann Corno
Modified: 2008-12-13 00:45 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 Yann Corno 2008-12-13 00:45:29 UTC
Line 326 of sa-learn.raw:

if ($synconly) {
  $spamtest->rebuild_learner_caches(
    {
      verbose  => 1,                # <----- PROBLEM
      showdots => $opt{'showdots'}
    }
  );


The "verbose  => 1" has the side effect of triggering info messages in DBM.pm (line 1318):

    my $msg = ("bayes: synced databases from journal in " .
	       ($done - $started) .
	       " seconds: $count unique entries ($total_count total entries)");
    if ($opts->{verbose}) {
      print $msg,"\n";
    } else {
      dbg($msg);
    }


As a result, if you run sa-learn as a cron job (like in the Debian package), the sysop gets lots of uninteresting warnings/e-mail everyday:

bayes: synced databases from journal in 1 seconds: 155 unique entries (232 total entries)
bayes: synced databases from journal in 2 seconds: 631 unique entries (912 total entries)


Suggestion: add a verbose option to sa-learn. By default, verbose mode should be OFF.