Commit 2d8e7153 authored by Jim Fulton's avatar Jim Fulton

Merge remote-tracking branch 'origin/asyncio' into register-returns-last-transaction

Conflicts:
	CHANGES.rst
parents 1387d850 3ae6ff6d
language: python language: python
sudo: false sudo: false
cache:
pip
directories:
- eggs
matrix: matrix:
include: include:
- os: linux - os: linux
...@@ -24,9 +28,8 @@ matrix: ...@@ -24,9 +28,8 @@ matrix:
python: 3.5 python: 3.5
env: ZEO4_SERVER=1 env: ZEO4_SERVER=1
install: install:
- pip install -U setuptools - pip install -U zc.buildout
- python bootstrap.py - buildout
- bin/buildout
script: script:
- bin/test -v1j99 - bin/test -v1j99
notifications: notifications:
......
...@@ -5,6 +5,14 @@ Changelog ...@@ -5,6 +5,14 @@ Changelog
transaction, allowing the client to avoid an extra round trip during transaction, allowing the client to avoid an extra round trip during
cache verification. cache verification.
- 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. - Fixed bugs in using the ZEO 5 client with ZEO 4 servers.
5.0.0a2 (2016-07-30) 5.0.0a2 (2016-07-30)
......
...@@ -180,12 +180,10 @@ Which is a short-hand for:: ...@@ -180,12 +180,10 @@ Which is a short-hand for::
connection = db.open() connection = db.open()
If you exit the Python process, the storage exits as well, as it's run If you exit the Python process, the storage exits as well, as it's run
in an in-process thread. It will leave behind it's configuration and in an in-process thread.
log file. This provides a handy way to get a configuration example.
You shut down the server more cleanly by calling the stop function You shut down the server more cleanly by calling the stop function
returned by the ``ZEO.server`` function. This will remove the returned by the ``ZEO.server`` function.
temporary configuration file.
To have data stored persistently, you can specify a file-storage path To have data stored persistently, you can specify a file-storage path
name using a ``path`` parameter. If you want blob support, you can name using a ``path`` parameter. If you want blob support, you can
......
...@@ -13,19 +13,26 @@ ...@@ -13,19 +13,26 @@
############################################################################## ##############################################################################
"""Exceptions for ZEO.""" """Exceptions for ZEO."""
import transaction.interfaces
from ZODB.POSException import StorageError from ZODB.POSException import StorageError
class ClientStorageError(StorageError): class ClientStorageError(StorageError):
"""An error occurred in the ZEO Client Storage.""" """An error occurred in the ZEO Client Storage.
"""
class UnrecognizedResult(ClientStorageError): class UnrecognizedResult(ClientStorageError):
"""A server call returned an unrecognized result.""" """A server call returned an unrecognized result.
"""
class ClientDisconnected(ClientStorageError): class ClientDisconnected(ClientStorageError,
"""The database storage is disconnected from the storage.""" transaction.interfaces.TransientError):
"""The database storage is disconnected from the storage.
"""
class AuthError(StorageError): class AuthError(StorageError):
"""The client provided invalid authentication credentials.""" """The client provided invalid authentication credentials.
"""
class ProtocolError(ClientStorageError): class ProtocolError(ClientStorageError):
"""A client contacted a server with an incomparible protocol """A client contacted a server with an incomparible protocol
......
...@@ -139,6 +139,7 @@ def runner(config, qin, qout, timeout=None, ...@@ -139,6 +139,7 @@ def runner(config, qin, qout, timeout=None,
) )
thread.setDaemon(True) thread.setDaemon(True)
thread.start() thread.start()
os.remove(config)
try: try:
qin.get(timeout=timeout) # wait for shutdown qin.get(timeout=timeout) # wait for shutdown
...@@ -181,7 +182,6 @@ def stop_runner(thread, config, qin, qout, stop_timeout=9, pid=None): ...@@ -181,7 +182,6 @@ def stop_runner(thread, config, qin, qout, stop_timeout=9, pid=None):
gc.collect() gc.collect()
thread.join(stop_timeout) thread.join(stop_timeout)
os.remove(config)
def start_zeo_server(storage_conf=None, zeo_conf=None, port=None, keep=False, def start_zeo_server(storage_conf=None, zeo_conf=None, port=None, keep=False,
path='Data.fs', protocol=None, blob_dir=None, path='Data.fs', protocol=None, blob_dir=None,
......
...@@ -1412,6 +1412,14 @@ call to the server. we'd get some sort of error here. ...@@ -1412,6 +1412,14 @@ call to the server. we'd get some sort of error here.
"""
def ClientDisconnected_errors_are_TransientErrors():
"""
>>> from ZEO.Exceptions import ClientDisconnected
>>> from transaction.interfaces import TransientError
>>> issubclass(ClientDisconnected, TransientError)
True
""" """
if sys.platform.startswith('win'): if sys.platform.startswith('win'):
......
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