------------------------------------------------------------
revno: 1317
committer: Mark Sapiro <msap...@value.net>
branch nick: 2.1
timestamp: Thu 2011-09-29 17:40:26 -0700
message:
  Eliminated the list cache from the qrunners.  Indirect self-references
  caused lists to never be dropped from the cache which in turn caused
  the qrunners to grow very large in installations with many lists or
  multiple large lists.  Bug #862683.
modified:
  Mailman/Queue/Runner.py
  NEWS


--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/Queue/Runner.py'
--- Mailman/Queue/Runner.py	2008-05-08 03:42:28 +0000
+++ Mailman/Queue/Runner.py	2011-09-30 00:40:26 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2011 by the Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -20,7 +20,6 @@
 
 import time
 import traceback
-import weakref
 from cStringIO import StringIO
 
 from Mailman import mm_cfg
@@ -198,22 +197,18 @@
         if keepqueued:
             self._switchboard.enqueue(msg, msgdata)
 
-    # Mapping of listnames to MailList instances as a weak value dictionary.
-    _listcache = weakref.WeakValueDictionary()
-
     def _open_list(self, listname):
-        # Cache the open list so that any use of the list within this process
-        # uses the same object.  We use a WeakValueDictionary so that when the
-        # list is no longer necessary, its memory is freed.
-        mlist = self._listcache.get(listname)
-        if not mlist:
-            try:
-                mlist = MailList.MailList(listname, lock=False)
-            except Errors.MMListError, e:
-                syslog('error', 'error opening list: %s\n%s', listname, e)
-                return None
-            else:
-                self._listcache[listname] = mlist
+        # We no longer cache the list instances.  Because of changes to
+        # MailList.py needed to avoid not reloading an updated list, caching
+        # is not as effective as it once was.  Also, with OldStyleMemberships
+        # as the MemberAdaptor, there was a self-reference to the list which
+        # kept all lists in the cache.  Changing this reference to a
+        # weakref.proxy created other issues.
+        try:
+            mlist = MailList.MailList(listname, lock=False)
+        except Errors.MMListError, e:
+            syslog('error', 'error opening list: %s\n%s', listname, e)
+            return None
         return mlist
 
     def _log(self, exc):

=== modified file 'NEWS'
--- NEWS	2011-09-29 23:39:46 +0000
+++ NEWS	2011-09-30 00:40:26 +0000
@@ -14,6 +14,11 @@
 
   New Features
 
+    - Eliminated the list cache from the qrunners.  Indirect self-references
+      caused lists to never be dropped from the cache which in turn caused
+      the qrunners to grow very large in installations with many lists or
+      multiple large lists.  Bug #862683.
+
     - The user options 'list my other subscriptions' page now indicates for
       each list if the subscription is 'nomail' or 'digest'.  Bug #793669.
 

_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to