[Mailman-Developers] Mysql MemberAdaptor 1.61 and Mailman 2.1.6

Mark Sapiro msapiro at value.net
Thu Oct 27 03:06:09 CEST 2005


Adrian Wells wrote:

>Mark Sapiro <msapiro at value.net> on Wednesday, October 26, 2005 at 3:45 PM
>+0000 wrote:
>>
>>Now, MysqlMemberships.py doesn't work in the same way. its
>>setBounceInfo and getBounceInfo methods take the attributes out of the
>>_BounceInfo instance and store them separately in the database and
>>vice versa, so saving the list doesn't commit any changes that
>>registerBounces may have made to the _BounceInfo instance.
>
>OK.  I imagine that not much can easily done to change this.


I think that's right. The MemberAdaptor is not supposed to be in the
business of determining when a _BounceInfo instance has changed behind
its back and divining when to commit changes to it. The documentation
in MemberAdaptor.py says that the getBounceInfo() method returns the
info that was set with setBounceInfo(), so except for what you
discovered about the cookie, MysqlMemberships.py appears to be doing
the right thing at this level.

Actually, it is not really doing the right thing because it is not
supposed to be aware of what's in the _BounceInfo class. The info that
is passed to it is a string representation of the _BounceInfo
instance, and it should really just be saving and retrieving that.
IMO, there should be just one column in the MySQL table for this
string representation. The only possible snag I see is that the string
contains new-lines, and I don't know MySQL so I don't know if
new-lines are allowed in a string field/column.

If MysqlMemberships.py were just storing and retrieving the
representation that it is passed, it wouldn't have to worry about
things like the fact that the 'cookie' argument disappeared from the
_BounceInfo instantiation call in Mailman 2.1.4


>>It looks good to me, but as you recognize, it's incomplete. As I said,
>>I'm the new kid on the block. It seems to me that this fix is the
>>right way to go, but others may differ. I've worked up a more complete
>>patch which is pasted to the end of this mail. It addresses the other
>>places where the bounce info is changed. I've also searched for places
>>outside Bouncer.py where bounce info is used, and I think they are all
>>OK as is.
>
>
>Thank you for looking over the patch and for providing a more complete
>patch.  Today, I also found the additional sections in which bounce info
>is changed (as covered by your patch).  However, I think there's a couple
>additional sections that the supplied patch misses - those are when the
>bounce information is reset (info.reset()).  So I've included another
>patch at the end of this message which seems to be even more complete.


Yes. I definitely overlooked the info.reset() two lines before the end
of registerBounce. Good Catch!

However in the earlier part of registerBounce, I deliberately combined
your two calls to setBounceInfo() in the "if info is stale" clause and
its "else" clause into a single call following the if - else but still
within the containing else.

I did this even though I think it is logically equivalent, because I
think that all else equal, fewer lines is better.


>>>As a minor side note, I noticed the bounce log receives two different
>>>formatted messages for the first bounce and subsequent bounces.  An
>>>example:
>>>...
>>>Oct 25 10:50:51 2005 (2687) samplelist: falseaddresstest at somedomain.net
>>>bounce score: 1.0
>>>Oct 25 11:06:54 2005 (2687) falseaddresstest at somedomain.net: samplelist
>>>current bounce score: 2.0
>>>...
>>>This is not a major issue but it is inconsistent and it not clear why it
>>>should be this way.  Is there reason is should be different?
>>
>>
>>I don't think so. All the other log messages from Bouncer are "list:
>>member". I don't see any reason why this one shouldn't also be that
>>way.
>
>
>OK.  Should this be entered as a bug on SF?


Yes, I think so, but I'd be inclined to wait a bit and see if there are
more comments from the list.


>This is the patch for the MysqlMemberships.py MemberAdaptor (note this
>patch was generated against an already patched/modified version of the
>Mysql MemberAdaptor 1.61):


As I indicate above, I think the better way to fix MysqlMemberships.py
is to remove its knowledge of the _BounceInfo class and just save and
retrieve the string representation that it is handed.

-- 
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Developers mailing list