Commit 564f8f8d authored by Jeremy Hylton's avatar Jeremy Hylton

Merge changes from Zope-2_7-branch to the trunk.

parent 78326867
......@@ -207,13 +207,6 @@ then this command will install the new ZEO and ZODB:
The install command should create a /home/zope/lib/python/ZEO directoy.
Simple configuration
--------------------
mkzeoinst.py
Or, do it step-by-step.
Configuring server
------------------
......@@ -407,13 +400,9 @@ Running the ZEO server as a daemon
In an operational setting, you will want to run the ZEO server a
daemon process that is restarted when it dies. The zdaemon package
provides two tools for running daemons: zdrun.py and zdctl.py.
The document "Using zdctl and zdrun to manage server processes"
explains how to use these scripts to manage daemons.
XXX example of how to use zdrun
XXX mkzeoinst.py docs should probably go here
provides two tools for running daemons: zdrun.py and zdctl.py. The
document "Using zdctl and zdrun to manage server processes"
(Doc/zdctl.txt) explains how to use these scripts to manage daemons.
Rotating log files
~~~~~~~~~~~~~~~~~~
......@@ -437,10 +426,6 @@ manages a ZEO servers password database.
Diagnosing problems
-------------------
How to use the debug logs.
Common gotchas.
If an exception occurs on the server, the server will log a traceback
and send an exception to the client. The traceback on the client will
show a ZEO protocol library as the source of the error. If you need
......
Client Cache Tracing
====================
ZEO Client Cache Tracing
========================
An important question for ZEO users is: how large should the ZEO
client cache be? ZEO 2 (as of ZEO 2.0b2) has a new feature that lets
......
......@@ -85,7 +85,7 @@ setup(name = "ExtensionClass",
url = "http://www.zope.com",
ext_modules = [ExtensionClass, Acquisition, ComputedAttribute,
MethodObject, Missing, MultiMapping,
MethodObject, Missing, MultiMapping,
ThreadLock, Record],
headers = ["src/ExtensionClass.h"],
......
......@@ -21,7 +21,7 @@ static char ExtensionClass_module_documentation[] =
" - They provide access to unbound methods,\n"
" - They can be called to create instances.\n"
"\n"
"$Id: ExtensionClass.c,v 1.61 2003/09/15 16:29:20 jeremy Exp $\n"
"$Id: ExtensionClass.c,v 1.62 2003/10/02 18:17:27 jeremy Exp $\n"
;
#include "ExtensionClass.h"
......
......@@ -14,7 +14,7 @@
"""Berkeley storage with full undo and versioning support.
$Revision: 1.73 $
$Revision: 1.74 $
"""
import time
......
......@@ -15,7 +15,7 @@
"""Berkeley storage without undo or versioning.
"""
__version__ = '$Revision: 1.31 $'[-2:][0]
__version__ = '$Revision: 1.32 $'[-2:][0]
from ZODB import POSException
from ZODB.utils import p64, U64
......@@ -125,7 +125,8 @@ class BDBMinimalStorage(BerkeleyBase, ConflictResolvingStorage):
if version is None:
self._info.put('version', BDBMINIMAL_SCHEMA_VERSION, txn=txn)
elif version <> BDBMINIMAL_SCHEMA_VERSION:
raise POSException.StorageSystemError, 'incompatible storage version'
raise POSException.StorageSystemError(
'incompatible storage version')
def _make_autopacker(self, event):
return _Autopack(self, event, self._config.frequency)
......
......@@ -16,6 +16,7 @@
"""
import os
import sys
import time
import errno
import shutil
......@@ -448,7 +449,9 @@ class BerkeleyBase(BaseStorage):
# i.e. abort the transaction -- but swallow the exception.
txn.abort()
except:
#import traceback ; traceback.print_exc()
## import traceback ; traceback.print_exc()
zLOG.LOG(self.__class__.__name__, zLOG.DEBUG,
"unexpected error in _withtxn", error=sys.exc_info())
txn.abort()
raise
else:
......
......@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
# Base class for unit tests at the ZODB layer
......
......@@ -2,12 +2,12 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
......@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
# Test creation of a brand new database, and insertion of root objects.
......@@ -19,7 +19,7 @@ import unittest
import BDBStorage
from BDBStorage.tests.ZODBTestBase import ZODBTestBase
from Persistence import PersistentMapping
class InsertMixin:
......
......@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
# Test some simple ZODB level stuff common to both the BDBMinimalStorage and
......
......@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
# Framework for running Unit tests
......
......@@ -4,14 +4,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
"""Time transaction commits and normalize vs. pickle size and #objects.
......@@ -240,10 +240,10 @@ def doit(srcdb, dstdb, options):
for r in txn:
oid = r.oid
objects += 1
thissize = len(r.data)
thissize = len(r.data)
size += thissize
if thissize > largest_pickle:
largest_pickle = thissize
if thissize > largest_pickle:
largest_pickle = thissize
if verbose:
if not r.version:
vstr = 'norev'
......@@ -266,10 +266,10 @@ def doit(srcdb, dstdb, options):
traceback.print_exc(file=logfp)
# record the results
if objects > largest_txn_in_objects:
largest_txn_in_objects = objects
if size > largest_txn_in_size:
largest_txn_in_size = size
if objects > largest_txn_in_objects:
largest_txn_in_objects = objects
if size > largest_txn_in_size:
largest_txn_in_size = size
print >> outfp, utils.U64(tid), objects, size, t4-t0, \
t1-t0, t2-t1, t3-t2, t4-t3
......
......@@ -4,14 +4,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
"""Time transaction commits and normalize vs. pickle size and #objects.
......@@ -206,7 +206,7 @@ def doit(srcdb, dstdb, options):
from bsddb3 import db
env = db.DBEnv()
env.open('BDB',
env.open('BDB',
db.DB_CREATE # create underlying files as necessary
| db.DB_RECOVER # run normal recovery before opening
| db.DB_INIT_MPOOL # initialize shared memory buffer pool
......@@ -252,34 +252,34 @@ def doit(srcdb, dstdb, options):
t1 = time.time()
try:
dbtxn = env.txn_begin()
dbtxn = env.txn_begin()
for r in txn:
oid = r.oid
objects += 1
thissize = len(r.data)
thissize = len(r.data)
size += thissize
if thissize > largest_pickle:
largest_pickle = thissize
if thissize > largest_pickle:
largest_pickle = thissize
if verbose:
if not r.version:
vstr = 'norev'
else:
vstr = r.version
print utils.U64(oid), vstr, len(r.data)
key = oid + tid
d.put(key, r.data, txn=dbtxn)
key = oid + tid
d.put(key, r.data, txn=dbtxn)
t2 = time.time()
t3 = time.time()
dbtxn.commit()
dbtxn.commit()
t4 = time.time()
except KeyError, e:
traceback.print_exc(file=logfp)
# record the results
if objects > largest_txn_in_objects:
largest_txn_in_objects = objects
if size > largest_txn_in_size:
largest_txn_in_size = size
if objects > largest_txn_in_objects:
largest_txn_in_objects = objects
if size > largest_txn_in_size:
largest_txn_in_size = size
print >> outfp, utils.U64(tid), objects, size, t4-t0, \
t1-t0, t2-t1, t3-t2, t4-t3
......
......@@ -21,4 +21,3 @@ class BaseLogger:
for handler in self.logger.handlers:
if hasattr(handler, 'reopen') and callable(handler.reopen):
handler.reopen()
......@@ -75,8 +75,3 @@ class StartupHandler(Handler):
for record in self.buffer:
target.handle(record)
self.buffer = []
......@@ -17,6 +17,7 @@ import sys
import tempfile
import unittest
import zLOG
import logging
severity_string = {
-300: 'TRACE',
......@@ -50,13 +51,24 @@ class StupidLogTest(unittest.TestCase):
self.wipeEnvironment()
self.path = tempfile.mktemp()
self._severity = 0
# Windows cannot remove a file that's open. The logging code
# keeps the log file open, and I can't find an advertised API
# to tell the logger to close a log file. So here we cheat:
# tearDown() will close and remove all the handlers that pop
# into existence after setUp() runs. This breaks into internals,
# but I couldn't find a sane way to do it.
self.handlers = logging._handlers.keys() # capture current handlers
def tearDown(self):
try:
os.remove(self.path)
except os.error:
pass
# Close and remove all the handlers that came into existence
# since setUp ran.
for h in logging._handlers.keys():
if h not in self.handlers:
h.close()
del logging._handlers[h]
os.remove(self.path)
self.wipeEnvironment()
zLOG.initialize()
def setLog(self, severity=0):
os.environ['%s_LOG_FILE' % self.prefix] = self.path
......@@ -111,14 +123,20 @@ class StupidLogTest(unittest.TestCase):
self.setLog()
zLOG.LOG("basic", zLOG.INFO, "summary")
f = self.getLogFile()
self.verifyEntry(f, subsys="basic", summary="summary")
try:
self.verifyEntry(f, subsys="basic", summary="summary")
finally:
f.close()
def checkDetail(self):
self.setLog()
zLOG.LOG("basic", zLOG.INFO, "xxx", "this is a detail")
f = self.getLogFile()
self.verifyEntry(f, subsys="basic", detail="detail")
try:
self.verifyEntry(f, subsys="basic", detail="detail")
finally:
f.close()
def checkError(self):
self.setLog()
......@@ -131,9 +149,13 @@ class StupidLogTest(unittest.TestCase):
zLOG.LOG("basic", zLOG.ERROR, "raised exception", error=err)
f = self.getLogFile()
self.verifyEntry(f, subsys="basic", summary="summary")
self.verifyEntry(f, subsys="basic", severity=zLOG.ERROR,
error=err)
try:
self.verifyEntry(f, subsys="basic", summary="summary")
self.verifyEntry(f, subsys="basic", severity=zLOG.ERROR,
error=err)
finally:
f.close()
class EventLogTest(StupidLogTest):
""" Test alternate envvars EVENT_LOG_FILE and EVENT_LOG_SEVERITY """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment