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: ...@@ -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. The install command should create a /home/zope/lib/python/ZEO directoy.
Simple configuration
--------------------
mkzeoinst.py
Or, do it step-by-step.
Configuring server Configuring server
------------------ ------------------
...@@ -407,13 +400,9 @@ Running the ZEO server as a daemon ...@@ -407,13 +400,9 @@ Running the ZEO server as a daemon
In an operational setting, you will want to run the ZEO server a In an operational setting, you will want to run the ZEO server a
daemon process that is restarted when it dies. The zdaemon package daemon process that is restarted when it dies. The zdaemon package
provides two tools for running daemons: zdrun.py and zdctl.py. provides two tools for running daemons: zdrun.py and zdctl.py. The
The document "Using zdctl and zdrun to manage server processes" document "Using zdctl and zdrun to manage server processes"
explains how to use these scripts to manage daemons. (Doc/zdctl.txt) explains how to use these scripts to manage daemons.
XXX example of how to use zdrun
XXX mkzeoinst.py docs should probably go here
Rotating log files Rotating log files
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
...@@ -437,10 +426,6 @@ manages a ZEO servers password database. ...@@ -437,10 +426,6 @@ manages a ZEO servers password database.
Diagnosing problems Diagnosing problems
------------------- -------------------
How to use the debug logs.
Common gotchas.
If an exception occurs on the server, the server will log a traceback 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 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 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 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 client cache be? ZEO 2 (as of ZEO 2.0b2) has a new feature that lets
......
...@@ -21,7 +21,7 @@ static char ExtensionClass_module_documentation[] = ...@@ -21,7 +21,7 @@ static char ExtensionClass_module_documentation[] =
" - They provide access to unbound methods,\n" " - They provide access to unbound methods,\n"
" - They can be called to create instances.\n" " - They can be called to create instances.\n"
"\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" #include "ExtensionClass.h"
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"""Berkeley storage with full undo and versioning support. """Berkeley storage with full undo and versioning support.
$Revision: 1.73 $ $Revision: 1.74 $
""" """
import time import time
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"""Berkeley storage without undo or versioning. """Berkeley storage without undo or versioning.
""" """
__version__ = '$Revision: 1.31 $'[-2:][0] __version__ = '$Revision: 1.32 $'[-2:][0]
from ZODB import POSException from ZODB import POSException
from ZODB.utils import p64, U64 from ZODB.utils import p64, U64
...@@ -125,7 +125,8 @@ class BDBMinimalStorage(BerkeleyBase, ConflictResolvingStorage): ...@@ -125,7 +125,8 @@ class BDBMinimalStorage(BerkeleyBase, ConflictResolvingStorage):
if version is None: if version is None:
self._info.put('version', BDBMINIMAL_SCHEMA_VERSION, txn=txn) self._info.put('version', BDBMINIMAL_SCHEMA_VERSION, txn=txn)
elif version <> BDBMINIMAL_SCHEMA_VERSION: elif version <> BDBMINIMAL_SCHEMA_VERSION:
raise POSException.StorageSystemError, 'incompatible storage version' raise POSException.StorageSystemError(
'incompatible storage version')
def _make_autopacker(self, event): def _make_autopacker(self, event):
return _Autopack(self, event, self._config.frequency) return _Autopack(self, event, self._config.frequency)
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
""" """
import os import os
import sys
import time import time
import errno import errno
import shutil import shutil
...@@ -448,7 +449,9 @@ class BerkeleyBase(BaseStorage): ...@@ -448,7 +449,9 @@ class BerkeleyBase(BaseStorage):
# i.e. abort the transaction -- but swallow the exception. # i.e. abort the transaction -- but swallow the exception.
txn.abort() txn.abort()
except: 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() txn.abort()
raise raise
else: else:
......
...@@ -21,4 +21,3 @@ class BaseLogger: ...@@ -21,4 +21,3 @@ class BaseLogger:
for handler in self.logger.handlers: for handler in self.logger.handlers:
if hasattr(handler, 'reopen') and callable(handler.reopen): if hasattr(handler, 'reopen') and callable(handler.reopen):
handler.reopen() handler.reopen()
...@@ -75,8 +75,3 @@ class StartupHandler(Handler): ...@@ -75,8 +75,3 @@ class StartupHandler(Handler):
for record in self.buffer: for record in self.buffer:
target.handle(record) target.handle(record)
self.buffer = [] self.buffer = []
...@@ -17,6 +17,7 @@ import sys ...@@ -17,6 +17,7 @@ import sys
import tempfile import tempfile
import unittest import unittest
import zLOG import zLOG
import logging
severity_string = { severity_string = {
-300: 'TRACE', -300: 'TRACE',
...@@ -50,13 +51,24 @@ class StupidLogTest(unittest.TestCase): ...@@ -50,13 +51,24 @@ class StupidLogTest(unittest.TestCase):
self.wipeEnvironment() self.wipeEnvironment()
self.path = tempfile.mktemp() self.path = tempfile.mktemp()
self._severity = 0 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): def tearDown(self):
try: # 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) os.remove(self.path)
except os.error:
pass
self.wipeEnvironment() self.wipeEnvironment()
zLOG.initialize()
def setLog(self, severity=0): def setLog(self, severity=0):
os.environ['%s_LOG_FILE' % self.prefix] = self.path os.environ['%s_LOG_FILE' % self.prefix] = self.path
...@@ -111,14 +123,20 @@ class StupidLogTest(unittest.TestCase): ...@@ -111,14 +123,20 @@ class StupidLogTest(unittest.TestCase):
self.setLog() self.setLog()
zLOG.LOG("basic", zLOG.INFO, "summary") zLOG.LOG("basic", zLOG.INFO, "summary")
f = self.getLogFile() f = self.getLogFile()
try:
self.verifyEntry(f, subsys="basic", summary="summary") self.verifyEntry(f, subsys="basic", summary="summary")
finally:
f.close()
def checkDetail(self): def checkDetail(self):
self.setLog() self.setLog()
zLOG.LOG("basic", zLOG.INFO, "xxx", "this is a detail") zLOG.LOG("basic", zLOG.INFO, "xxx", "this is a detail")
f = self.getLogFile() f = self.getLogFile()
try:
self.verifyEntry(f, subsys="basic", detail="detail") self.verifyEntry(f, subsys="basic", detail="detail")
finally:
f.close()
def checkError(self): def checkError(self):
self.setLog() self.setLog()
...@@ -131,9 +149,13 @@ class StupidLogTest(unittest.TestCase): ...@@ -131,9 +149,13 @@ class StupidLogTest(unittest.TestCase):
zLOG.LOG("basic", zLOG.ERROR, "raised exception", error=err) zLOG.LOG("basic", zLOG.ERROR, "raised exception", error=err)
f = self.getLogFile() f = self.getLogFile()
try:
self.verifyEntry(f, subsys="basic", summary="summary") self.verifyEntry(f, subsys="basic", summary="summary")
self.verifyEntry(f, subsys="basic", severity=zLOG.ERROR, self.verifyEntry(f, subsys="basic", severity=zLOG.ERROR,
error=err) error=err)
finally:
f.close()
class EventLogTest(StupidLogTest): class EventLogTest(StupidLogTest):
""" Test alternate envvars EVENT_LOG_FILE and EVENT_LOG_SEVERITY """ """ 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