[Zodb-checkins] SVN: ZODB/branches/zcZODB-3.8/ Merged revs 91440-92292 from 3.8 branch.

Jim Fulton jim at zope.com
Fri Oct 17 10:21:39 EDT 2008


Log message for revision 92297:
  Merged revs 91440-92292 from 3.8 branch.
  

Changed:
  U   ZODB/branches/zcZODB-3.8/NEWS.txt
  U   ZODB/branches/zcZODB-3.8/README.txt
  U   ZODB/branches/zcZODB-3.8/buildout.cfg
  U   ZODB/branches/zcZODB-3.8/setup.py
  U   ZODB/branches/zcZODB-3.8/src/ZEO/tests/testZEO.py
  U   ZODB/branches/zcZODB-3.8/src/ZODB/Connection.py
  U   ZODB/branches/zcZODB-3.8/src/ZODB/lock_file.py
  U   ZODB/branches/zcZODB-3.8/src/ZODB/lock_file.txt
  U   ZODB/branches/zcZODB-3.8/src/ZODB/tests/testConnection.py
  U   ZODB/branches/zcZODB-3.8/src/ZODB/tests/testblob.py
  U   ZODB/branches/zcZODB-3.8/src/persistent/wref.py

-=-
Modified: ZODB/branches/zcZODB-3.8/NEWS.txt
===================================================================
--- ZODB/branches/zcZODB-3.8/NEWS.txt	2008-10-17 14:02:48 UTC (rev 92296)
+++ ZODB/branches/zcZODB-3.8/NEWS.txt	2008-10-17 14:21:33 UTC (rev 92297)
@@ -4,67 +4,78 @@
 
 Bugs Fixed:
 
-- (beta 9) Fixed a bug to allow opening of deep-copied blobs.
+- (3.8.1) 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).
 
-- (beta 9) Fixed bug #189542 by prepending the module to an undefined name.
+- (3.8.1) An exception would be raised when an error occured attempting to
+  lock a file and logging of said error was enabled.
 
-- (beta 8) If there is a failure while FileStorage is finalizing a transaction,
+- (3.8.1) Fixed a bug to allow opening of deep-copied blobs.
+
+- (3.8.1) Fixed bug #189542 by prepending the module to an undefined name.
+
+- (3.8.1) Failures in tpc_finish of client-storages weren't handled
+  correctly, leaving the client storage in an inconsistent state.
+
+- (3.8.1) If there is a failure while FileStorage is finalizing a transaction,
   the file storage is closed because it's internal meta data may be
   invalid.
 
-- (beta 8) FileStorages previously saved indexes after a certain
+- (3.8.1) FileStorages previously saved indexes after a certain
   number of writes.  This was done during the last phase of two-phase
   commit, which made this critical phase more subject to errors than
   it should have been.  Also, for large databases, saves were done so
   infrequently as to be useless.  The feature was removed to reduce
   the chance for errors during the last phase of two-phase commit.
 
-- (beta 8) File storages previously kept an internal object id to
+- (3.8.1) File storages previously kept an internal object id to
   transaction id mapping as an optimization. This mapping caused
   excessive memory usage and failures during the last phase of
   two-phase commit. This optimization has been removed.
 
-- (beta 8) Fixed a bug that caused deep copying of blobs to fail.
+- (3.8.1) Fixed a bug that caused deep copying of blobs to fail.
 
-- (beta 8) Refactored handling of invalidations on ZEO clients to fix
+- (3.8.1) Refactored handling of invalidations on ZEO clients to fix
   a possible ordering problem for invalidation messages.
 
-- (beta 8) An ZEO cache internal data structure can get out of sync
+- (3.8.1) An ZEO cache internal data structure can get out of sync
   with the data in a way that prevents data from being loaded into the
   cache. We don't yet know why, but added an exception handler to
   prevent this error from being fatal.
 
-- (beta 8) Fixed setup.py use of setuptools vs distutils, so .c and .h
+- (3.8.1) Fixed setup.py use of setuptools vs distutils, so .c and .h
   files are included in the bdist_egg.
 
-- (beta 8) On many systems, it was impossible to create more than 32K
+- (3.8.1) On many systems, it was impossible to create more than 32K
   blobs. Added a new blob-directory layout to work around this
   limitation.
 
-- (beta 7) Fixed a bug, introduced in an earlier beta, that allowed
+- (3.8.1) Fixed a bug, introduced in an earlier beta, that allowed
   clients to connect to out of date servers.
 
-- (beta 7) Fixed bug that could lead to memory errors due to the use
+- (3.8.1) Fixed bug that could lead to memory errors due to the use
   of a Python dictionary for a mapping that can grow large.
 
-- (beta 7) Fixed bug #251037: Made packing of blob storages non-blocking.
+- (3.8.1) Fixed bug #251037: Made packing of blob storages non-blocking.
 
-- (beta 6) Fixed a bug that could cause InvalidObjectReference errors
+- (3.8.1) Fixed a bug that could cause InvalidObjectReference errors
   for objects that were explicitly added to a database if the object
   was modified after a savepoint that added the object.
 
-- (beta 5) Fixed several bugs that caused ZEO cache corruption when connecting
+- (3.8.1) Fixed several bugs that caused ZEO cache corruption when connecting
   to servers. These bugs affected both persistent and non-persistent caches. 
 
-- (beta 5) Improved the the ZEO client shutdown support to try to
+- (3.8.1) Improved the the ZEO client shutdown support to try to
   avoid spurious errors on exit, especially for scripts, such as zeopack.
 
-- (beta 4) Packing failed for databases containing cross-database references.
+- (3.8.1) Packing failed for databases containing cross-database references.
 
-- (beta 3) Cross-database references to databases with empty names
+- (3.8.1) Cross-database references to databases with empty names
   weren't constructed properly.
 
-- (beta 2) The cache used an excessive amount of memory, causing applications
+- (3.8.1) The cache used an excessive amount of memory, causing applications
   with large caches to exhaust available memory. 
 
 - Fixed a number of bugs in the handling of persistent ZEO caches:

Modified: ZODB/branches/zcZODB-3.8/README.txt
===================================================================
--- ZODB/branches/zcZODB-3.8/README.txt	2008-10-17 14:02:48 UTC (rev 92296)
+++ ZODB/branches/zcZODB-3.8/README.txt	2008-10-17 14:21:33 UTC (rev 92297)
@@ -1,6 +1,10 @@
+
 ZODB 3.8
 ========
 
+.. contents::
+
+
 Introduction
 ------------
 
@@ -11,8 +15,8 @@
 - Core ZODB, including the persistence machinery
 - Standard storages such as FileStorage
 - The persistent BTrees modules
-- ZEO
-- documentation (poor)
+- ZEO, for scalability needs
+- documentation (needs more work)
 
 Our primary development platforms are Linux, Mac OS X, and Windows
 XP.  The test suite should pass without error on all of these
@@ -81,7 +85,7 @@
 Testing for Developers
 ----------------------
 
-The ZODB check outs are `buldouts <http://www.python.org/pypi/zc.buildout>`_.
+The ZODB checkouts are `buildouts <http://www.python.org/pypi/zc.buildout>`_.
 When working from a ZODB checkout, first run the bootstrap.py script
 to initialize the buildout:
 
@@ -115,6 +119,15 @@
     OK
 
 
+Maintenance scripts
+-------------------
+
+Several scripts are provided with the ZODB and can help for analyzing,
+debugging, checking for consistency, summarizing content, reporting space used
+by objects, doing backups, artificial load testing, etc.
+Look at the ZODB/script directory for more informations.
+
+
 History
 -------
 
@@ -148,9 +161,7 @@
 StandaloneZODB is a bit of a mouthful.  The standalone part of the
 name suggests that the Zope version is the real version and that this
 is an afterthought, which isn't the case.  So we're calling this
-release "ZODB".
-
-To make matters worse, we worked on a ZODB4 package for a while and
+release "ZODB". We also worked on a ZODB4 package for a while and
 made a couple of alpha releases.  We've now abandoned that effort,
 because we didn't have the resources to pursue ot while also maintaining
 ZODB(3).
@@ -201,10 +212,9 @@
 Bugs and Patches
 ----------------
 
-Bug reports and patches should be added to the Zope Collector, with
-topic "Database":
+Bug reports and patches should be added to the Launchpad:
 
-    http://collector.zope.org/Zope
+    https://launchpad.net/zodb
 
 
 ..

Modified: ZODB/branches/zcZODB-3.8/buildout.cfg
===================================================================
--- ZODB/branches/zcZODB-3.8/buildout.cfg	2008-10-17 14:02:48 UTC (rev 92296)
+++ ZODB/branches/zcZODB-3.8/buildout.cfg	2008-10-17 14:21:33 UTC (rev 92297)
@@ -6,6 +6,11 @@
 [test]
 recipe = zc.recipe.testrunner
 eggs = ZODB3
+initialization = 
+  import os, tempfile, shutil
+  if os.path.exists('tmp'): shutil.rmtree('tmp')
+  os.mkdir('tmp')
+  tempfile.tempdir = os.path.abspath('tmp')
 
 [scripts]
 recipe = zc.recipe.egg

Modified: ZODB/branches/zcZODB-3.8/setup.py
===================================================================
--- ZODB/branches/zcZODB-3.8/setup.py	2008-10-17 14:02:48 UTC (rev 92296)
+++ ZODB/branches/zcZODB-3.8/setup.py	2008-10-17 14:21:33 UTC (rev 92297)
@@ -20,7 +20,7 @@
 interface, rich transaction support, and undo.
 """
 
-VERSION = "3.8.1dev"
+VERSION = "3.8.2dev"
 
 # The (non-obvious!) choices for the Trove Development Status line:
 # Development Status :: 5 - Production/Stable
@@ -245,7 +245,8 @@
         self.cmdclass['build_py'] = MyPyBuilder
         self.cmdclass['install_lib'] = MyLibInstaller
 
-doclines = __doc__.split("\n")
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
 
 
 setup(name="ZODB3",
@@ -260,8 +261,13 @@
                  'src/persistent/ring.h'],
       license = "ZPL 2.1",
       platforms = ["any"],
-      description = doclines[0],
+      description = __doc__.split("\n")[0],
       classifiers = filter(None, classifiers.split("\n")),
-      long_description = "\n".join(doclines[2:]),
+      long_description = (
+            __doc__
+            + read('README.txt')
+            + '\n\n'
+            + read('NEWS.txt')
+            ),
       distclass = MyDistribution,
       **extra)

Modified: ZODB/branches/zcZODB-3.8/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/branches/zcZODB-3.8/src/ZEO/tests/testZEO.py	2008-10-17 14:02:48 UTC (rev 92296)
+++ ZODB/branches/zcZODB-3.8/src/ZEO/tests/testZEO.py	2008-10-17 14:21:33 UTC (rev 92297)
@@ -601,7 +601,8 @@
 
     def checkTransactionBufferCleanup(self):
         oid = self._storage.new_oid()
-        handle, blob_file_name = tempfile.mkstemp() #XXX cleanup temp file
+        handle, blob_file_name = tempfile.mkstemp()
+        os.close(handle)
         open(blob_file_name, 'w').write('I am a happy blob.')
         t = transaction.Transaction()
         self._storage.tpc_begin(t)

Modified: ZODB/branches/zcZODB-3.8/src/ZODB/Connection.py
===================================================================
--- ZODB/branches/zcZODB-3.8/src/ZODB/Connection.py	2008-10-17 14:02:48 UTC (rev 92296)
+++ ZODB/branches/zcZODB-3.8/src/ZODB/Connection.py	2008-10-17 14:21:33 UTC (rev 92297)
@@ -1036,7 +1036,8 @@
         self._invalidatedCache = False
         cache_size = self._cache.cache_size
         cache_size_bytes = self._cache.cache_size_bytes
-        self._cache = cache = PickleCache(self, cache_size, cache_size_bytes)
+        self._reader._cache = self._cache = PickleCache(self, cache_size,
+                                                        cache_size_bytes)
 
     ##########################################################################
     # Python protocol

Modified: ZODB/branches/zcZODB-3.8/src/ZODB/lock_file.py
===================================================================
--- ZODB/branches/zcZODB-3.8/src/ZODB/lock_file.py	2008-10-17 14:02:48 UTC (rev 92296)
+++ ZODB/branches/zcZODB-3.8/src/ZODB/lock_file.py	2008-10-17 14:21:33 UTC (rev 92297)
@@ -82,7 +82,9 @@
             fp.seek(1)
             pid = fp.read().strip()[:20]
             fp.close()
-            logger.exception("Error locking file", path, pid)
+            if not pid:
+                pid = 'UNKNOWN'
+            logger.exception("Error locking file %s; pid=%s", path, pid)
             raise
 
         self._fp = fp

Modified: ZODB/branches/zcZODB-3.8/src/ZODB/lock_file.txt
===================================================================
--- ZODB/branches/zcZODB-3.8/src/ZODB/lock_file.txt	2008-10-17 14:02:48 UTC (rev 92296)
+++ ZODB/branches/zcZODB-3.8/src/ZODB/lock_file.txt	2008-10-17 14:21:33 UTC (rev 92297)
@@ -9,14 +9,20 @@
     >>> import ZODB.lock_file
     >>> lock = ZODB.lock_file.LockFile('lock')
 
-If we try to lock the same name, we'll get a lock error:
+If we try to lock the same name, we'll get a lock error and it will be logged:
 
+    >>> import ZODB.tests.loggingsupport
+    >>> handler = ZODB.tests.loggingsupport.InstalledHandler('ZODB.lock_file')
     >>> try:
     ...     ZODB.lock_file.LockFile('lock')
     ... except ZODB.lock_file.LockError:
     ...     print "Can't lock file"
     Can't lock file
 
+    >>> for record in handler.records:
+    ...     print record.levelname, record.getMessage()
+    ERROR Error locking file lock; pid=UNKNOWN
+
 To release the lock, use it's close method:
 
     >>> lock.close()

Modified: ZODB/branches/zcZODB-3.8/src/ZODB/tests/testConnection.py
===================================================================
--- ZODB/branches/zcZODB-3.8/src/ZODB/tests/testConnection.py	2008-10-17 14:02:48 UTC (rev 92296)
+++ ZODB/branches/zcZODB-3.8/src/ZODB/tests/testConnection.py	2008-10-17 14:21:33 UTC (rev 92297)
@@ -140,6 +140,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

Modified: ZODB/branches/zcZODB-3.8/src/ZODB/tests/testblob.py
===================================================================
--- ZODB/branches/zcZODB-3.8/src/ZODB/tests/testblob.py	2008-10-17 14:02:48 UTC (rev 92296)
+++ ZODB/branches/zcZODB-3.8/src/ZODB/tests/testblob.py	2008-10-17 14:21:33 UTC (rev 92297)
@@ -144,7 +144,10 @@
         # (even though it won't contain the original data)
         clone.open()
 
+        # tearDown
+        database.close()
 
+
 class BlobUndoTests(BlobTests):
 
     def testUndoWithoutPreviousVersion(self):

Modified: ZODB/branches/zcZODB-3.8/src/persistent/wref.py
===================================================================
--- ZODB/branches/zcZODB-3.8/src/persistent/wref.py	2008-10-17 14:02:48 UTC (rev 92296)
+++ ZODB/branches/zcZODB-3.8/src/persistent/wref.py	2008-10-17 14:21:33 UTC (rev 92297)
@@ -16,6 +16,8 @@
 $Id$
 """
 
+__docformat__ = "reStructuredText"
+
 from persistent import Persistent
 
 WeakRefMarker = object()
@@ -28,11 +30,11 @@
     object to be called when the object is removed from the database.
 
     Here's an example. We'll start by creating a persistent object and
-    a refernce to it:
+    a reference to it:
 
-    >>> import persistent.list
+    >>> import persistent, ZODB.tests.MinPO
     >>> import ZODB.tests.util
-    >>> ob = persistent.list.PersistentList()
+    >>> ob = ZODB.tests.MinPO.MinPO()
     >>> ref = WeakRef(ob)
     >>> ref() is ob
     True
@@ -47,7 +49,7 @@
     >>> WeakRef(ob) == ref
     True
 
-    >>> ob2 = persistent.list.PersistentList([1])
+    >>> ob2 = ZODB.tests.MinPO.MinPO(1)
     >>> WeakRef(ob2) == ref
     False
 



More information about the Zodb-checkins mailing list