Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
82a63bb0
Commit
82a63bb0
authored
Dec 18, 2008
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
POSKeyErrors are really client errors
parent
efe06091
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
33 deletions
+50
-33
src/CHANGES.txt
src/CHANGES.txt
+3
-0
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+37
-31
src/ZEO/zrpc/connection.py
src/ZEO/zrpc/connection.py
+10
-2
No files found.
src/CHANGES.txt
View file @
82a63bb0
...
...
@@ -32,6 +32,9 @@ New Features
- You can now control whether FileStorages keep .old files when packing.
- POSKeyErrors are no longer logged by ZEO servers, because they are
really client errors.
3.9.0a8 (2008-12-15)
====================
...
...
src/ZEO/tests/testZEO.py
View file @
82a63bb0
...
...
@@ -13,53 +13,43 @@
##############################################################################
"""Test suite for ZEO based on ZODB.tests."""
# System imports
from
ZEO.ClientStorage
import
ClientStorage
from
ZEO.tests.forker
import
get_port
from
ZEO.tests
import
forker
,
Cache
,
CommitLockTests
,
ThreadTests
from
ZEO.tests
import
IterationTests
from
ZEO.zrpc.error
import
DisconnectedError
from
ZODB.tests
import
StorageTestBase
,
BasicStorage
,
\
TransactionalUndoStorage
,
\
PackableStorage
,
Synchronization
,
ConflictResolution
,
RevisionStorage
,
\
MTStorage
,
ReadOnlyStorage
,
IteratorStorage
,
RecoveryStorage
from
ZODB.tests.MinPO
import
MinPO
from
ZODB.tests.StorageTestBase
import
zodb_unpickle
from
ZODB.tests.testDemoStorage
import
DemoStorageWrappedBase
import
asyncore
import
doctest
import
logging
import
os
import
persistent
import
shutil
import
signal
import
stat
import
tempfile
import
threading
import
time
import
transaction
import
unittest
import
shutil
# ZODB test support
import
ZEO.ServerStub
import
ZEO.StorageServer
import
ZEO.tests.ConnectionTests
import
ZEO.zrpc.connection
import
ZODB
import
ZODB.blob
import
ZODB.tests.util
import
ZODB.tests.testblob
from
ZODB.tests.MinPO
import
MinPO
from
ZODB.tests.StorageTestBase
import
zodb_unpickle
import
persistent
import
transaction
import
ZODB.tests.util
import
ZODB.utils
import
zope.testing.setupstack
# ZODB test mixin classes
from
ZODB.tests
import
StorageTestBase
,
BasicStorage
,
\
TransactionalUndoStorage
,
\
PackableStorage
,
Synchronization
,
ConflictResolution
,
RevisionStorage
,
\
MTStorage
,
ReadOnlyStorage
,
IteratorStorage
,
RecoveryStorage
from
ZODB.tests.testDemoStorage
import
DemoStorageWrappedBase
from
ZEO.ClientStorage
import
ClientStorage
from
ZEO.zrpc.error
import
DisconnectedError
import
ZEO.zrpc.connection
from
ZEO.tests
import
forker
,
Cache
,
CommitLockTests
,
ThreadTests
,
\
IterationTests
from
ZEO.tests.forker
import
get_port
import
ZEO.tests.ConnectionTests
import
ZEO.StorageServer
logger
=
logging
.
getLogger
(
'ZEO.tests.testZEO'
)
class
DummyDB
:
...
...
@@ -1150,6 +1140,22 @@ def history_over_zeo():
>>> db.close()
"""
def
dont_log_poskeyerrors_on_server
():
"""
>>> addr, admin = start_server()
>>> import ZEO.ClientStorage
>>> cs = ZEO.ClientStorage.ClientStorage(addr)
>>> cs.load(ZODB.utils.p64(1))
Traceback (most recent call last):
...
POSKeyError: 0x01
>>> cs.close()
>>> stop_server(admin)
>>> 'POSKeyError' in open('server-%s.log' % addr[1]).read()
False
"""
slow_test_classes
=
[
BlobAdaptedFileStorageTests
,
BlobWritableCacheTests
,
...
...
src/ZEO/zrpc/connection.py
View file @
82a63bb0
...
...
@@ -27,6 +27,7 @@ from ZEO.zrpc.marshal import Marshaller
from
ZEO.zrpc.trigger
import
trigger
from
ZEO.zrpc.log
import
short_repr
,
log
from
ZODB.loglevels
import
BLATHER
,
TRACE
import
ZODB.POSException
REPLY
=
".reply"
# message name used for replies
ASYNC
=
1
...
...
@@ -377,6 +378,9 @@ class Connection(smac.SizedMessageAsyncConnection, object):
# sends Z303 to server
# OK, because Z303 is in the server's clients_we_can_talk_to
# Exception types that should not be logged:
unlogged_exception_types
=
()
# Client constructor passes 'C' for tag, server constructor 'S'. This
# is used in log messages, and to determine whether we can speak with
# our peer.
...
...
@@ -569,8 +573,9 @@ class Connection(smac.SizedMessageAsyncConnection, object):
except
(
SystemExit
,
KeyboardInterrupt
):
raise
except
Exception
,
msg
:
self
.
log
(
"%s() raised exception: %s"
%
(
name
,
msg
),
logging
.
INFO
,
exc_info
=
True
)
if
not
isinstance
(
msg
,
self
.
unlogged_exception_types
):
self
.
log
(
"%s() raised exception: %s"
%
(
name
,
msg
),
logging
.
INFO
,
exc_info
=
True
)
error
=
sys
.
exc_info
()[:
2
]
return
self
.
return_error
(
msgid
,
flags
,
*
error
)
...
...
@@ -780,6 +785,9 @@ class Connection(smac.SizedMessageAsyncConnection, object):
class
ManagedServerConnection
(
Connection
):
"""Server-side Connection subclass."""
# Exception types that should not be logged:
unlogged_exception_types
=
(
ZODB
.
POSException
.
POSKeyError
,
)
# Servers use a shared server trigger that uses the asyncore socket map
trigger
=
trigger
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment