Skip to content

Commit

Permalink
Merge pull request #61 from zopefoundation/ClientDisconnected-is-tran…
Browse files Browse the repository at this point in the history
…sient

Client disconnect errors are now transient errors.

Apparently, travis doesn't want to test this branch. :(
  • Loading branch information
jimfulton committed Aug 5, 2016
2 parents a07f8af + 5a927e2 commit 3ae6ff6
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
9 changes: 6 additions & 3 deletions .travis.yml
@@ -1,5 +1,9 @@
language: python
sudo: false
cache:
pip
directories:
- eggs
matrix:
include:
- os: linux
Expand All @@ -24,9 +28,8 @@ matrix:
python: 3.5
env: ZEO4_SERVER=1
install:
- pip install -U setuptools
- python bootstrap.py
- bin/buildout
- pip install -U zc.buildout
- buildout
script:
- bin/test -v1j99
notifications:
Expand Down
8 changes: 8 additions & 0 deletions CHANGES.rst
@@ -1,6 +1,14 @@
Changelog
=========

- Client disconnect errors are now transient errors. When
applications retry jobs that raise transient errors, jobs (e.g. web
requests) with disconnect errors will be retried. Together with
blocking synchronous ZEO server calls for a limited time while
disconnected, this change should allow brief disconnections due to
server restart to avoid generating client-visible errors (e.g. 500
web responses).

- Fixed bugs in using the ZEO 5 client with ZEO 4 servers.

5.0.0a2 (2016-07-30)
Expand Down
17 changes: 12 additions & 5 deletions src/ZEO/Exceptions.py
Expand Up @@ -13,19 +13,26 @@
##############################################################################
"""Exceptions for ZEO."""

import transaction.interfaces

from ZODB.POSException import StorageError

class ClientStorageError(StorageError):
"""An error occurred in the ZEO Client Storage."""
"""An error occurred in the ZEO Client Storage.
"""

class UnrecognizedResult(ClientStorageError):
"""A server call returned an unrecognized result."""
"""A server call returned an unrecognized result.
"""

class ClientDisconnected(ClientStorageError):
"""The database storage is disconnected from the storage."""
class ClientDisconnected(ClientStorageError,
transaction.interfaces.TransientError):
"""The database storage is disconnected from the storage.
"""

class AuthError(StorageError):
"""The client provided invalid authentication credentials."""
"""The client provided invalid authentication credentials.
"""

class ProtocolError(ClientStorageError):
"""A client contacted a server with an incomparible protocol
Expand Down
8 changes: 8 additions & 0 deletions src/ZEO/tests/testZEO.py
Expand Up @@ -1411,6 +1411,14 @@ def gracefully_handle_abort_while_storing_many_blobs():
"""

def ClientDisconnected_errors_are_TransientErrors():
"""
>>> from ZEO.Exceptions import ClientDisconnected
>>> from transaction.interfaces import TransientError
>>> issubclass(ClientDisconnected, TransientError)
True
"""

if sys.platform.startswith('win'):
Expand Down

0 comments on commit 3ae6ff6

Please sign in to comment.