You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2007/07/04 16:14:17 UTC
[Bug 5547] New: calculate_expire_delta return value in BayesStore SQL.pm causes Perl warning
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5547
Summary: calculate_expire_delta return value in BayesStore SQL.pm
causes Perl warning
Product: Spamassassin
Version: SVN Trunk (Latest Devel Version)
Platform: Other
OS/Version: All
Status: NEW
Severity: trivial
Priority: P5
Component: spamassassin
AssignedTo: dev@spamassassin.apache.org
ReportedBy: peter@unlikejam.dreamhost.com
The calculate_expire_delta function in BayesStore/SQL.pm can return undef,
which creates a warning (turns up in procmail logs):
warn: Odd number of elements in hash assignment at BayesStore.pm line 322.
warn: Use of uninitialized value in list assignment at BayesStore.pm line 322.
It should probably return an empty hash at that point (as per the patch), since
%delta may have information in it by that stage which we don't want to return,
since the function didn't complete.
Also need to make sure that the expected behaviour of "return 0 unless
(%delta);" is maintained in BayesStore.pm, after this call is made:
my %delta = $self->calculate_expire_delta($vars[10], $start, $max_expire_mult);
Relevant dbg output - note the trigger is the SQL connection going away (not
sure why, since the email still gets scored with bayes):
[32655] dbg: bayes: can't use estimation method for expiry, unexpected result,
calculating optimal atime delta (first pass)
[32655] dbg: bayes: expiry max exponent: 9
[32655] dbg: bayes: calculate_expire_delta: SQL error: Lost connection to MySQL
server during query
[32655] warn: Odd number of elements in hash assignment at /perl/lib/Mail/
SpamAssassin/BayesStore.pm line 322.
[32655] warn: Use of uninitialized value in list assignment at /perl/lib/Mail/
SpamAssassin/BayesStore.pm line 322.
[32655] dbg: bayes: atime token reduction
[32655] dbg: bayes: ======== ===============
[32655] dbg: bayes: 43200 0
[32655] dbg: bayes: 86400 0
[32655] dbg: bayes: 172800 0
[32655] dbg: bayes: 345600 0
[32655] dbg: bayes: 691200 0
[32655] dbg: bayes: 1382400 0
[32655] dbg: bayes: 2764800 0
[32655] dbg: bayes: 5529600 0
[32655] dbg: bayes: 11059200 0
[32655] dbg: bayes: 22118400 0
[32655] dbg: bayes: couldn't find a good delta atime, need more token
difference, skipping expire
[32655] dbg: bayes: set_last_expire: SQL error: MySQL server has gone away
[32655] dbg: bayes: remove_running_expire_tok: SQL error: MySQL server has gone
away
[32655] dbg: bayes: expiry completed
Output of sa-learn --dump magic for reference:
0.000 0 3 0 non-token data: bayes db version
0.000 0 3215 0 non-token data: nspam
0.000 0 5188 0 non-token data: nham
0.000 0 174856 0 non-token data: ntokens
0.000 0 1163584595 0 non-token data: oldest atime
0.000 0 1183554698 0 non-token data: newest atime
0.000 0 0 0 non-token data: last journal sync atime
0.000 0 1183472725 0 non-token data: last expiry atime
0.000 0 13725329 0 non-token data: last expire atime delta
0.000 0 0 0 non-token data: last expire reduction
count
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 5547] calculate_expire_delta return value in BayesStore SQL.pm causes Perl warning
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5547
------- Additional Comments From peter@unlikejam.dreamhost.com 2007-09-28 17:59 -------
If possible, could this trivial patch be reviewed for 3.2.4? In the mean time I
have been manually patching local installations and the patch resolves the
warning. See also #5661 related to SQL.pm. Cheers.
(In reply to comment #0)
> The calculate_expire_delta function in BayesStore/SQL.pm can return undef,
> which creates a warning (turns up in procmail logs):
> warn: Odd number of elements in hash assignment at BayesStore.pm line 322.
> warn: Use of uninitialized value in list assignment at BayesStore.pm line 322.
>
> It should probably return an empty hash at that point (as per the patch), since
> %delta may have information in it by that stage which we don't want to return,
> since the function didn't complete.
>
> Also need to make sure that the expected behaviour of "return 0 unless
> (%delta);" is maintained in BayesStore.pm, after this call is made:
> my %delta = $self->calculate_expire_delta($vars[10], $start, $max_expire_mult);
>
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 5547] calculate_expire_delta return value in BayesStore SQL.pm causes Perl warning
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5547
------- Additional Comments From peter@unlikejam.dreamhost.com 2007-07-04 07:16 -------
Created an attachment (id=4031)
--> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=4031&action=view)
Change return value of BayesStore/SQL.pm::calculate_expire_delta to empty hash
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.