[Zodb-checkins] SVN: ZODB/branches/3.7/ LP #142667: ensure _reader uses new cache in _resetCache.

Tres Seaver tseaver at palladion.com
Thu Oct 9 22:43:21 EDT 2008


Log message for revision 91956:
  LP #142667:  ensure _reader uses new cache in _resetCache.

Changed:
  U   ZODB/branches/3.7/NEWS.txt
  U   ZODB/branches/3.7/setup.py
  U   ZODB/branches/3.7/src/ZODB/Connection.py
  U   ZODB/branches/3.7/src/ZODB/tests/testConnection.py

-=-
Modified: ZODB/branches/3.7/NEWS.txt
===================================================================
--- ZODB/branches/3.7/NEWS.txt	2008-10-10 02:24:58 UTC (rev 91955)
+++ ZODB/branches/3.7/NEWS.txt	2008-10-10 02:43:20 UTC (rev 91956)
@@ -1,6 +1,35 @@
+What's new on ZODB 3.7.3?
+=========================
+
+Release date:  DD-MMM-YYYY
+
+Connection
+----------
+
+- (3.7.3) Reset ``_cache`` on a connection's ``_reader`` object when
+  resetting the cache, to prevent reads from the old cache object, e.g.
+  during Zope2's auto-refresh of products.
+  (https://bugs.launchpad.net/zodb/+bug/142667).
+
+
+What's new on ZODB 3.7.2?
+=========================
+
+Release date:  27-Sep-2007
+
+ClientStorage
+-------------
+
+- (3.7.2) Fixed a serious bug that could cause client I/O to stop
+  (hang). This was accomonied by a critical log message along the
+  lines of: "RuntimeError: dictionary changed size during iteration".
+
+
 What's new on ZODB 3.7.1?
 =========================
 
+Release date:  03-Jul-2007
+
 Packaging
 ---------
 
@@ -19,10 +48,6 @@
 ClientStorage
 -------------
 
-- (3.7.2) Fixed a serious bug that could cause client I/O to stop
-  (hang). This was accomonied by a critical log message along the
-  lines of: "RuntimeError: dictionary changed size during iteration".
-
 - (3.7b4) Added logic to avoid spurious errors from the logging system
   on exit.
 

Modified: ZODB/branches/3.7/setup.py
===================================================================
--- ZODB/branches/3.7/setup.py	2008-10-10 02:24:58 UTC (rev 91955)
+++ ZODB/branches/3.7/setup.py	2008-10-10 02:43:20 UTC (rev 91956)
@@ -20,7 +20,7 @@
 interface, rich transaction support, and undo.
 """
 
-VERSION = "3.7.2"
+VERSION = "3.7.3dev"
 
 # The (non-obvious!) choices for the Trove Development Status line:
 # Development Status :: 5 - Production/Stable

Modified: ZODB/branches/3.7/src/ZODB/Connection.py
===================================================================
--- ZODB/branches/3.7/src/ZODB/Connection.py	2008-10-10 02:24:58 UTC (rev 91955)
+++ ZODB/branches/3.7/src/ZODB/Connection.py	2008-10-10 02:43:20 UTC (rev 91956)
@@ -983,6 +983,8 @@
         self._invalidatedCache = False
         cache_size = self._cache.cache_size
         self._cache = cache = PickleCache(self, cache_size)
+        if getattr(self, '_reader', None) is not None:
+            self._reader._cache = cache
 
     ##########################################################################
     # Python protocol

Modified: ZODB/branches/3.7/src/ZODB/tests/testConnection.py
===================================================================
--- ZODB/branches/3.7/src/ZODB/tests/testConnection.py	2008-10-10 02:24:58 UTC (rev 91955)
+++ ZODB/branches/3.7/src/ZODB/tests/testConnection.py	2008-10-10 02:43:20 UTC (rev 91956)
@@ -146,6 +146,14 @@
         self.datamgr.tpc_finish(self.transaction)
         self.assert_(obj._p_oid not in self.datamgr._storage._stored)
 
+    def check__resetCacheResetsReader(self):
+        # https://bugs.launchpad.net/zodb/+bug/142667
+        old_cache = self.datamgr._cache
+        self.datamgr._resetCache()
+        new_cache = self.datamgr._cache
+        self.failIf(new_cache is old_cache)
+        self.failUnless(self.datamgr._reader._cache is new_cache)
+
 class UserMethodTests(unittest.TestCase):
 
     # add isn't tested here, because there are a bunch of traditional



More information about the Zodb-checkins mailing list