------------------------------------------------------------
revno: 1023
committer: Mark Sapiro <[email protected]>
branch nick: 2.2
timestamp: Fri 2008-12-19 12:59:20 -0800
message:
  Backed out the previous change and eliminated the qrunner list cache instead.
modified:
  Mailman/OldStyleMemberships.py
  Mailman/Queue/Runner.py
  NEWS

=== modified file 'Mailman/OldStyleMemberships.py'
--- a/Mailman/OldStyleMemberships.py    2008-12-13 04:32:09 +0000
+++ b/Mailman/OldStyleMemberships.py    2008-12-19 20:59:20 +0000
@@ -25,7 +25,6 @@
 """
 
 import time
-import weakref
 from types import StringType
 
 from Mailman import mm_cfg
@@ -46,9 +45,7 @@
 
 class OldStyleMemberships(MemberAdaptor.MemberAdaptor):
     def __init__(self, mlist):
-        # Make only a weak reference to the list to avoid locking the list
-        # in the qrunner cache via the self._memberadaptor reference.
-        self.__mlist = weakref.proxy(mlist)
+        self.__mlist = mlist
 
     #
     # Read interface

=== modified file 'Mailman/Queue/Runner.py'
--- a/Mailman/Queue/Runner.py   2008-05-08 03:42:28 +0000
+++ b/Mailman/Queue/Runner.py   2008-12-19 20:59:20 +0000
@@ -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'
--- a/NEWS      2008-12-07 19:50:43 +0000
+++ b/NEWS      2008-12-19 20:59:20 +0000
@@ -27,6 +27,12 @@
       and multi-line entries are 'ored'.  Existing Topics regexps will be
       converted when the list is updated so they will continue to work.
 
+    - 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 fixes and other patches
 
     - Changed the 'Approve' wording in the admindbdetails.html template to



--
Active development version (web u/i update)
https://code.launchpad.net/~mailman-coders/mailman/2.2

You are receiving this branch notification because you are subscribed to it.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to