[Mailman-Developers] Database version updates drop nomail settings

Dan Mick dmick@utopia.West.Sun.COM
Mon, 11 Feb 2002 10:56:56 -0800


Argh, not again!!!.....

sigh.  Yes, all my bounce_info[] seems to be gone.


Les Niles wrote:
> 
> There's a small bug in 2.1alpha4 in updating a list's database to
> the DATA_FILE_VERSION, causing "nomail" settings to not be
> propagated forward:
> 
> MailList.CheckVersion() reloads the database, taking care to make
> sure that the reload doesn't trigger a recursive call to
> CheckVersion().  But if the list wasn't locked, CheckVersion() then
> calls Lock(), and Lock() calls Load() again, this time generating a
> recursive call to CheckVersion().  This recursion is only one deep
> because now the list is locked, but even that is too much for
> versions.CanonicalizeUserOptions() since it clears the old-style
> "nomail" flag after setting the delivery status in the new
> database.
> 
> Here's a patch that fixes this.
> 
>   -les
> 
> ---------------------------------------------------------------------
> 
> *** MailList.py.orig    Sun Jan  6 23:04:01 2002
> --- MailList.py Sat Feb  9 22:42:36 2002
> ***************
> *** 146,157 ****
>       #
>       # Lock management
>       #
> !     def Lock(self, timeout=0):
>           self.__lock.lock(timeout)
>           # Must reload our database for consistency.  Watch out for lists that
>           # don't exist.
>           try:
> !             self.Load()
>           except Exception:
>               self.Unlock()
>               raise
> --- 146,157 ----
>       #
>       # Lock management
>       #
> !     def Lock(self, timeout=0, check_version=1):
>           self.__lock.lock(timeout)
>           # Must reload our database for consistency.  Watch out for lists that
>           # don't exist.
>           try:
> !             self.Load(check_version)
>           except Exception:
>               self.Unlock()
>               raise
> ***************
> *** 557,563 ****
>           # We must hold the list lock in order to update the schema
>           waslocked = self.Locked()
>           if not waslocked:
> !             self.Lock()
>           try:
>               from versions import Update
>               Update(self, stored_state)
> --- 558,564 ----
>           # We must hold the list lock in order to update the schema
>           waslocked = self.Locked()
>           if not waslocked:
> !             self.Lock(check_version=0)
>           try:
>               from versions import Update
>               Update(self, stored_state)
> 
> _______________________________________________
> Mailman-Developers mailing list
> Mailman-Developers@python.org
> http://mail.python.org/mailman/listinfo/mailman-developers