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
Hide 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
...
@@ -32,6 +32,9 @@ New Features
- You can now control whether FileStorages keep .old files when packing.
- 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)
3.9.0a8 (2008-12-15)
====================
====================
...
...
src/ZEO/tests/testZEO.py
View file @
82a63bb0
...
@@ -13,53 +13,43 @@
...
@@ -13,53 +13,43 @@
##############################################################################
##############################################################################
"""Test suite for ZEO based on ZODB.tests."""
"""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
asyncore
import
doctest
import
doctest
import
logging
import
logging
import
os
import
os
import
persistent
import
shutil
import
signal
import
signal
import
stat
import
stat
import
tempfile
import
tempfile
import
threading
import
threading
import
time
import
time
import
transaction
import
unittest
import
unittest
import
shutil
# ZODB test support
import
ZEO.ServerStub
import
ZEO.ServerStub
import
ZEO.StorageServer
import
ZEO.tests.ConnectionTests
import
ZEO.zrpc.connection
import
ZODB
import
ZODB
import
ZODB.blob
import
ZODB.blob
import
ZODB.tests.util
import
ZODB.tests.testblob
import
ZODB.tests.testblob
from
ZODB.tests.MinPO
import
MinPO
import
ZODB.tests.util
from
ZODB.tests.StorageTestBase
import
zodb_unpickle
import
ZODB.utils
import
persistent
import
transaction
import
zope.testing.setupstack
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'
)
logger
=
logging
.
getLogger
(
'ZEO.tests.testZEO'
)
class
DummyDB
:
class
DummyDB
:
...
@@ -1150,6 +1140,22 @@ def history_over_zeo():
...
@@ -1150,6 +1140,22 @@ def history_over_zeo():
>>> db.close()
>>> 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
=
[
slow_test_classes
=
[
BlobAdaptedFileStorageTests
,
BlobWritableCacheTests
,
BlobAdaptedFileStorageTests
,
BlobWritableCacheTests
,
...
...
src/ZEO/zrpc/connection.py
View file @
82a63bb0
...
@@ -27,6 +27,7 @@ from ZEO.zrpc.marshal import Marshaller
...
@@ -27,6 +27,7 @@ from ZEO.zrpc.marshal import Marshaller
from
ZEO.zrpc.trigger
import
trigger
from
ZEO.zrpc.trigger
import
trigger
from
ZEO.zrpc.log
import
short_repr
,
log
from
ZEO.zrpc.log
import
short_repr
,
log
from
ZODB.loglevels
import
BLATHER
,
TRACE
from
ZODB.loglevels
import
BLATHER
,
TRACE
import
ZODB.POSException
REPLY
=
".reply"
# message name used for replies
REPLY
=
".reply"
# message name used for replies
ASYNC
=
1
ASYNC
=
1
...
@@ -377,6 +378,9 @@ class Connection(smac.SizedMessageAsyncConnection, object):
...
@@ -377,6 +378,9 @@ class Connection(smac.SizedMessageAsyncConnection, object):
# sends Z303 to server
# sends Z303 to server
# OK, because Z303 is in the server's clients_we_can_talk_to
# 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
# Client constructor passes 'C' for tag, server constructor 'S'. This
# is used in log messages, and to determine whether we can speak with
# is used in log messages, and to determine whether we can speak with
# our peer.
# our peer.
...
@@ -569,8 +573,9 @@ class Connection(smac.SizedMessageAsyncConnection, object):
...
@@ -569,8 +573,9 @@ class Connection(smac.SizedMessageAsyncConnection, object):
except
(
SystemExit
,
KeyboardInterrupt
):
except
(
SystemExit
,
KeyboardInterrupt
):
raise
raise
except
Exception
,
msg
:
except
Exception
,
msg
:
self
.
log
(
"%s() raised exception: %s"
%
(
name
,
msg
),
logging
.
INFO
,
if
not
isinstance
(
msg
,
self
.
unlogged_exception_types
):
exc_info
=
True
)
self
.
log
(
"%s() raised exception: %s"
%
(
name
,
msg
),
logging
.
INFO
,
exc_info
=
True
)
error
=
sys
.
exc_info
()[:
2
]
error
=
sys
.
exc_info
()[:
2
]
return
self
.
return_error
(
msgid
,
flags
,
*
error
)
return
self
.
return_error
(
msgid
,
flags
,
*
error
)
...
@@ -780,6 +785,9 @@ class Connection(smac.SizedMessageAsyncConnection, object):
...
@@ -780,6 +785,9 @@ class Connection(smac.SizedMessageAsyncConnection, object):
class
ManagedServerConnection
(
Connection
):
class
ManagedServerConnection
(
Connection
):
"""Server-side Connection subclass."""
"""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
# Servers use a shared server trigger that uses the asyncore socket map
trigger
=
trigger
()
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