[Zodb-checkins] SVN: ZODB/branches/jim-dev/src/ZEO/ checkpoint

Jim Fulton jim at zope.com
Wed Dec 3 19:23:06 EST 2008


Log message for revision 93595:
  checkpoint

Changed:
  U   ZODB/branches/jim-dev/src/ZEO/ClientStorage.py
  U   ZODB/branches/jim-dev/src/ZEO/tests/zeo_blob_cache.test

-=-
Modified: ZODB/branches/jim-dev/src/ZEO/ClientStorage.py
===================================================================
--- ZODB/branches/jim-dev/src/ZEO/ClientStorage.py	2008-12-03 23:05:21 UTC (rev 93594)
+++ ZODB/branches/jim-dev/src/ZEO/ClientStorage.py	2008-12-04 00:23:06 UTC (rev 93595)
@@ -507,9 +507,9 @@
                    try:
                        size = os.stat(file_name).st_size
                        try:
-                           os.remove(file_name)
-                       except OSError:
-                           raise
+                           ZODB.blob.remove_committed(file_name)
+                       except OSError, v:
+                           pass # probably open on windows
                        else:
                            size -= size
                    finally:
@@ -1025,16 +1025,8 @@
 
         
         if os.path.exists(blob_filename):
-            try:
-                _accessed(blob_filename)
-            except OSError:
-                # It might have been deleted while we were calling _accessed.
-                # We don't have the file lock.
-                if os.path.exists(blob_filename):
-                    raise
-            return blob_filename
+            return _accessed(blob_filename)
 
-
         # First, we'll create the directory for this oid, if it doesn't exist. 
         self.fshelper.createPathForOID(oid)
 
@@ -1650,5 +1642,8 @@
             )
 
 def _accessed(filename):
-    os.utime(filename, (time.time(), os.stat(filename).st_mtime))
+    try:
+        os.utime(filename, (time.time(), os.stat(filename).st_mtime))
+    except OSError:
+        pass # We tried. :)
     return filename

Modified: ZODB/branches/jim-dev/src/ZEO/tests/zeo_blob_cache.test
===================================================================
--- ZODB/branches/jim-dev/src/ZEO/tests/zeo_blob_cache.test	2008-12-03 23:05:21 UTC (rev 93594)
+++ ZODB/branches/jim-dev/src/ZEO/tests/zeo_blob_cache.test	2008-12-04 00:23:06 UTC (rev 93595)
@@ -66,7 +66,7 @@
     
     >>> db.storage._check_blob_size_thread.join()
 
-    >>> cache_size('blobs') < 5000
+    >>> cache_size('blobs') < 6000
     True
 
 If we read all of the blobs, data will be downloaded again, as
@@ -80,7 +80,7 @@
 
     >>> db.storage._check_blob_size_thread.join()
 
-    >>> cache_size('blobs') < 5000
+    >>> cache_size('blobs') < 6000
     True
 
     >>> for i in range(1, 101):
@@ -97,7 +97,7 @@
 
     >>> db.storage._check_blob_size_thread.join()
 
-    >>> cache_size('blobs') < 5000
+    >>> cache_size('blobs') < 6000
     True
 
     >>> for i in range(1, 101):
@@ -107,7 +107,7 @@
 
     >>> db.storage._check_blob_size_thread.join()
 
-    >>> cache_size('blobs') < 5000
+    >>> cache_size('blobs') < 6000
     True
 
 Now let see if we can stress things a bit.  We'll create many clients
@@ -140,7 +140,7 @@
     >>> for thread in threads:
     ...     thread.join()
 
-    >>> cache_size('blobs') < 5000
+    >>> cache_size('blobs') < 6000
     True
 
 .. cleanup



More information about the Zodb-checkins mailing list