[moving thread to mailman-developers, since I think I found a bug
-- and sorry for the huge quote, but I think the change of audience
requires it]
On 21 November 2004, I said:
I'm trying to upgrade from Mailman 2.1.4 to 2.1.5 on a Debian "testing"
system, using "apt-get install mailman". The upgrade seems to be
falling down in two places at various times. First variation:
"""
# apt-get install mailman
Reading Package Lists... Done
Building Dependency Tree... Done
mailman is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Setting up mailman (2.1.5-3) ...
Looking for enabled languages (this may take some time) ... done.
Installing site language de ................................ done.
Installing site language en ............................................ done.
Upgrading from version 0x20103f0 to 0x20105f0
getting rid of old source files
Updating mailing list: mailman
Updating the held requests database.
- updating old private mbox file
Your installation seems up-to-date, great!
- updating old public mbox file
Fixing language templates: mailman
Updating mailing list: crew
Resetting 2 BYBOUNCEs disabled addrs with no bounce info
Traceback (most recent call last):
File "/usr/lib/mailman/bin/update", line 753, in ?
errors = main()
File "/usr/lib/mailman/bin/update", line 643, in main
errors = errors + dolist(listname)
File "/usr/lib/mailman/bin/update", line 218, in dolist
mlist.setDeliveryStatus(addr, ENABLED)
File "/var/lib/mailman/Mailman/OldStyleMemberships.py", line 338, in setDeliveryStatus
self.__assertIsMember(member)
File "/var/lib/mailman/Mailman/OldStyleMemberships.py", line 113, in __assertIsMember
raise Errors.NotAMemberError, member
Mailman.Errors.NotAMemberError: timehorse,timehorse@unforgettable.com
dpkg: error processing mailman (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
mailman
E: Sub-process /usr/bin/dpkg returned an error code (1)
"""
When I saw this, I shrugged, figured I'd look in more detail later, and
just tried again. This time it's getting bogged down in the middle of
updating the pending.pck file:
"""
# apt-get install mailman
Reading Package Lists... Done
Building Dependency Tree... Done
mailman is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Setting up mailman (2.1.5-3) ...
Looking for enabled languages (this may take some time) ... done.
Installing site language de ................................ done.
Installing site language en ............................................ done.
Upgrading from version 0x20103f0 to 0x20105f0
getting rid of old source files
Updating mailing list: mailman
[...]
Updating Usenet watermarks
- nothing to update here
Updating Mailman 2.1.4 pending.pck database
"""
The [...] went by quite quickly. After printing the last line, 'update'
just sits there. Interrupting it gives a useful traceback:
Traceback (most recent call last):
File "/usr/lib/mailman/bin/update", line 753, in ?
errors = main()
File "/usr/lib/mailman/bin/update", line 677, in main
update_pending()
File "/usr/lib/mailman/bin/update", line 572, in update_pending
mlist = MailList.MailList(listname)
File "/var/lib/mailman/Mailman/MailList.py", line 126, in __init__
self.Lock()
File "/var/lib/mailman/Mailman/MailList.py", line 159, in Lock
self.__lock.lock(timeout)
File "/var/lib/mailman/Mailman/LockFile.py", line 312, in lock
self.__sleep()
File "/var/lib/mailman/Mailman/LockFile.py", line 496, in __sleep
time.sleep(interval)
KeyboardInterrupt
Hmmmm... so it looks like it's trying to get the lock on a list. Not
sure which one, but here's a clue:
OK, it looks like this is what happened:
* the first failure (NotAMemberError) crashed update, and it
did not clean up its locks
* so when I ran update again, it hung trying to lock the list that
it crashed on the last time through
Looking at the loop of setDeliveryStatus() calls in dolist() (see around
lines 215-220 in bin/update), it's pretty obvious how an exception from
setDeliveryStatus() can cause havoc. One naive fix is to catch
MemberError from setDeliveryStatus():
--- update 2004-11-01 11:22:53.000000000 +0100
+++ update.hacked 2004-11-21 20:08:21.000000000 +0100
@@ -51,6 +51,7 @@
from Mailman import MailList
from Mailman import Message
from Mailman import Pending
+from Mailman import Errors
from Mailman.LockFile import TimeOutError
from Mailman.i18n import _
from Mailman.Queue.Switchboard import Switchboard
@@ -215,7 +216,11 @@
print _(
'Resetting %(n)s BYBOUNCEs disabled addrs with no bounce info')
for addr in noinfo.keys():
- mlist.setDeliveryStatus(addr, ENABLED)
+ try:
+ mlist.setDeliveryStatus(addr, ENABLED)
+ except Errors.MemberError, err:
+ print "ERROR setting delivery status"
+ print repr(err)
# Update the held requests database
print _("""Updating the held requests database.""")
(patch relative to bin/update from a Debian mailman_2.1.5-3
installation). But I presume it would be cleaner to wrap a try/finally
around most of dolist().
Anyways, with this patch in place, I am able to run update successfully
-- ie. no hanging getting a lock.
Greg
--
Greg Ward <gward@python.net> http://www.gerg.ca/
Jesus Saves -- but Moses gets the rebound, he shoots, he SCORES!