[Zope-Checkins] CVS: Packages/ZODB - FileStorage.py:1.135.6.6

Tim Peters tim.one at comcast.net
Mon Jun 21 22:11:14 EDT 2004


Update of /cvs-repository/Packages/ZODB
In directory cvs.zope.org:/tmp/cvs-serv12383/ZODB

Modified Files:
      Tag: Zope-2_7-branch
	FileStorage.py 
Log Message:
Collector 1327:  FileStorage init confused by time travel

If the system clock moved back in time more than 30 days between
a FileStorage close and (re)open, new txn ids could be smaller
than txn ids already in the database.  Plugged that hole.

Includes a stripped-down rewrite of the new test in ZODB 3.3.  Main
difference is that this version doesn't automatically check that new
log messages are actually produced; that's easier to do in 3.3,
building on an extension to the logging package Jim wrote for Zope 3.


=== Packages/ZODB/FileStorage.py 1.135.6.5 => 1.135.6.6 ===
--- Packages/ZODB/FileStorage.py:1.135.6.5	Fri Jun 18 10:37:42 2004
+++ Packages/ZODB/FileStorage.py	Mon Jun 21 22:10:44 2004
@@ -302,10 +302,12 @@
         t = time.time()
         t = TimeStamp(*time.gmtime(t)[:5] + (t % 60,))
         if tid > t:
-            warn("%s Database records in the future", file_name);
-            if tid.timeTime() - t.timeTime() > 86400*30:
-                # a month in the future? This is bogus, use current time
-                self._ts = t
+            seconds = tid.timeTime() - t.timeTime()
+            complainer = warn
+            if seconds > 30 * 60:   # 30 minutes -- way screwed up
+                complainer = nearPanic
+            complainer("%s Database records %d seconds in the future",
+                       file_name, seconds)
 
         self._quota = quota
 




More information about the Zope-Checkins mailing list