[Zope3-checkins] CVS: ZODB/src/ZODB/FileStorage -
FileStorage.py:1.12 fspack.py:1.10
Tim Peters
tim.one at comcast.net
Wed Mar 17 15:50:08 EST 2004
Update of /cvs-repository/ZODB/src/ZODB/FileStorage
In directory cvs.zope.org:/tmp/cvs-serv23275/src/ZODB/FileStorage
Modified Files:
FileStorage.py fspack.py
Log Message:
By popular demand, FileStorage.pack() no longer propagates a
FileStorageError: The database has already been packed to a
later time or no changes have been made since the last pack
exception. Instead that message is logged (at INFO level), and
the pack attempt simply returns then (no pack is performed).
Incidentally, this should repair frequent reports of failure in the
new checkPackLotsWhileWriting test. On non-Windows systems, it
seems that the worker thread often didn't get enough cycles to commit
a change between the main thread's attempts to run pack() (and so
the exception above got raised then).
=== ZODB/src/ZODB/FileStorage/FileStorage.py 1.11 => 1.12 ===
--- ZODB/src/ZODB/FileStorage/FileStorage.py:1.11 Tue Mar 16 18:51:06 2004
+++ ZODB/src/ZODB/FileStorage/FileStorage.py Wed Mar 17 15:50:06 2004
@@ -46,7 +46,7 @@
def fsIndex():
return {}
-from zLOG import LOG, BLATHER, WARNING, ERROR, PANIC
+from zLOG import LOG, BLATHER, INFO, WARNING, ERROR, PANIC
t32 = 1L << 32
@@ -55,6 +55,9 @@
def blather(message, *data):
LOG('ZODB FS', BLATHER, "%s blather: %s\n" % (packed_version,
message % data))
+def info(message, *data):
+ LOG('ZODB FS', INFO, "%s info: %s\n" % (packed_version,
+ message % data))
def warn(message, *data):
LOG('ZODB FS', WARNING, "%s warn: %s\n" % (packed_version,
@@ -96,6 +99,10 @@
POSException.StorageSystemError):
"""File storage quota exceeded."""
+# Intended to be raised only in fspack.py, and ignored here.
+class RedundantPackWarning(FileStorageError):
+ pass
+
class TempFormatter(FileStorageFormatter):
"""Helper class used to read formatted FileStorage data."""
@@ -1329,7 +1336,11 @@
self._commit_lock_release,
current_size)
try:
- opos = p.pack()
+ opos = None
+ try:
+ opos = p.pack()
+ except RedundantPackWarning, detail:
+ info(str(detail))
if opos is None:
return
oldpath = self._file_name + ".old"
=== ZODB/src/ZODB/FileStorage/fspack.py 1.9 => 1.10 ===
--- ZODB/src/ZODB/FileStorage/fspack.py:1.9 Tue Mar 16 18:51:06 2004
+++ ZODB/src/ZODB/FileStorage/fspack.py Wed Mar 17 15:50:06 2004
@@ -273,8 +273,8 @@
if th.status == 'p':
# Delay import to cope with circular imports.
# XXX put exceptions in a separate module
- from ZODB.FileStorage.FileStorage import FileStorageError
- raise FileStorageError(
+ from ZODB.FileStorage.FileStorage import RedundantPackWarning
+ raise RedundantPackWarning(
"The database has already been packed to a later time"
" or no changes have been made since the last pack")
More information about the Zope3-Checkins
mailing list