Bug 4305 - remove use of Storable in spamd
Summary: remove use of Storable in spamd
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: Other other
: P5 major
Target Milestone: 3.1.0
Assignee: Justin Mason
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 3346
  Show dependency tree
 
Reported: 2005-05-05 00:12 UTC by Justin Mason
Modified: 2005-05-08 16:50 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
fix patch None Justin Mason [HasCLA]
revised fix patch None Justin Mason [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Mason 2005-05-05 00:12:52 UTC
There's been a number of issues with our use of Storable to store configuration
data, including a reasonably widely-reported (although very tricky to reproduce)
set of hangs under load on SMP linux systems which appear to be Storable-related.

workaround: don't use Storable!  patch to follow.
Comment 1 Justin Mason 2005-05-05 00:18:51 UTC
Created attachment 2842 [details]
fix

ok, here's a patch that does this -- it passes 'make test', but I'd like some
more eyes before I check it in.

key points:
  - it keeps the Mail::SpamAssassin::copy_config() public API compatible with
3.0.0's, or at least with what the POD documentation says. ;)  this is
important, because after all it was a public API in that release.
  - however, the implementation has been moved to Mail::SpamAssassin::Conf,
since it was an Official OO Bad Thing for Mail::SpamAssassin code to have to
know so much about the internal structure of the Conf class of objects.  it's
cleaner ot have that in Conf.
  - there's no use of Storable left anywhere in the main distro (outside of
masses/rule-qa). yay!
Comment 2 Daniel Quinlan 2005-05-05 00:26:22 UTC
Subject: Re:  remove use of Storable in spamd

It looks good for the most part.  However, I don't particularly like the
special cases.  I'd rather all the data in conf was handled
consistently.  I'm okay with objects that need to be cloned, but I don't
like special-casing them in the copy code.  It should be clear what do
to by how they are defined in conf.

Comment 3 Justin Mason 2005-05-05 10:47:16 UTC
'It looks good for the most part.  However, I don't particularly like the
special cases.  I'd rather all the data in conf was handled
consistently.  I'm okay with objects that need to be cloned, but I don't
like special-casing them in the copy code.  It should be clear what do
to by how they are defined in conf.'

not sure how you'd intend to do that ;)   could you explain?
Comment 4 Daniel Quinlan 2005-05-05 13:19:01 UTC
Subject: Re:  remove use of Storable in spamd

> not sure how you'd intend to do that ;)

A naming convention might work.

  ->{conf}->{object}

and anything under that would have the call.  There's probably a better way.

> could you explain?

Well, I really do not like these special cases:

     elsif ($k =~ /^(internal|trusted)_networks$/) {

     if ($v->{nets}) {

     elsif ($k eq 'scores') {

Comment 5 Auto-Mass-Checker 2005-05-05 15:09:01 UTC
Subject: Re:  remove use of Storable in spamd 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> A naming convention might work.

good point -- I hadn't thought of that.  OK, let me have a try...

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFCeplsMJF5cimLx9ARAt69AKCPH/MOf2KrK1kRGVMi1r7te+JIpwCfdif8
JVlIhspSjVbht6zBuEkfviw=
=F5Zo
-----END PGP SIGNATURE-----

Comment 6 Justin Mason 2005-05-05 22:18:43 UTC
Created attachment 2848 [details]
revised fix

ok, here's a revised version; it fixes a couple of bugs, simplifies the clone()
code a little, and hopefully makes the code a bit less special-case-y.

Daniel, I looked into the idea of making the name reflect the scoping, but that
increases overhead quite a lot -- it means that all the code that *uses* that
variable has to change in (possibly multiple) places to deal with cleaning up a
special case in one, single, well-defined place.  doesn't make sense...
Comment 7 Justin Mason 2005-05-09 00:50:49 UTC
checked in -- r169246.