remove all kombu<4.0.0 workarounds
we lower cap at kombu>=4.0.0 so no need to support kombu3 stuff Change-Id: I4c3bc4de6026b089fffae7ae4d34f718d45cb972
This commit is contained in:
parent
093afc2455
commit
631ade59bc
@ -596,24 +596,6 @@ class Connection(object):
|
||||
' %(hostname)s:%(port)s',
|
||||
self._get_connection_info())
|
||||
|
||||
# FIXME(gordc): wrapper to catch both kombu v3 and v4 errors
|
||||
# remove this and only catch OperationalError when >4.0.0
|
||||
if hasattr(kombu.exceptions, 'OperationalError'):
|
||||
self.recoverable_errors = kombu.exceptions.OperationalError
|
||||
else:
|
||||
# NOTE(sileht): Some dummy driver like the in-memory one doesn't
|
||||
# have notion of recoverable connection, so we must raise the
|
||||
# original exception like kombu does in this case.
|
||||
has_modern_errors = hasattr(
|
||||
self.connection.transport, 'recoverable_connection_errors',
|
||||
)
|
||||
if has_modern_errors:
|
||||
self.recoverable_errors = (
|
||||
self.connection.recoverable_channel_errors +
|
||||
self.connection.recoverable_connection_errors)
|
||||
else:
|
||||
self.recoverable_errors = ()
|
||||
|
||||
# NOTE(sileht): kombu recommend to run heartbeat_check every
|
||||
# seconds, but we use a lock around the kombu connection
|
||||
# so, to not lock to much this lock to most of the time do nothing
|
||||
@ -825,7 +807,7 @@ class Connection(object):
|
||||
ret, channel = autoretry_method()
|
||||
self._set_current_channel(channel)
|
||||
return ret
|
||||
except self.recoverable_errors as exc:
|
||||
except kombu.exceptions.OperationalError as exc:
|
||||
LOG.debug("Received recoverable error from kombu:",
|
||||
exc_info=True)
|
||||
error_callback and error_callback(exc)
|
||||
@ -895,7 +877,7 @@ class Connection(object):
|
||||
try:
|
||||
for consumer, tag in self._consumers.items():
|
||||
consumer.cancel(tag=tag)
|
||||
except self.recoverable_errors:
|
||||
except kombu.exceptions.OperationalError:
|
||||
self.ensure_connection()
|
||||
self._consumers.clear()
|
||||
self._active_tags.clear()
|
||||
@ -1006,7 +988,7 @@ class Connection(object):
|
||||
self.connection.drain_events(timeout=0.001)
|
||||
except socket.timeout:
|
||||
pass
|
||||
except self.recoverable_errors as exc:
|
||||
except kombu.exceptions.OperationalError as exc:
|
||||
LOG.info(_LI("A recoverable connection/channel error "
|
||||
"occurred, trying to reconnect: %s"), exc)
|
||||
self.ensure_connection()
|
||||
|
@ -26,7 +26,6 @@ PyYAML>=3.10.0 # MIT
|
||||
|
||||
# rabbit driver is the default
|
||||
# we set the amqp version to ensure heartbeat works
|
||||
# FIXME(gordc): bump to amqp2 and kombu4 once requirements updated
|
||||
amqp!=2.1.4,>=2.1.0 # BSD
|
||||
kombu!=4.0.2,>=4.0.0 # BSD
|
||||
pika>=0.10.0 # BSD
|
||||
|
@ -27,8 +27,5 @@ pip install -c$localfile openstack-requirements
|
||||
edit-constraints $localfile -- $CLIENT_NAME
|
||||
|
||||
pip install -c$localfile -U $*
|
||||
# NOTE(gordc): temporary override since kombu capped at <4.0.0
|
||||
pip install -U 'amqp>=2.0.0'
|
||||
pip install -U 'kombu>=4.0.0'
|
||||
|
||||
exit $?
|
||||
|
4
tox.ini
4
tox.ini
@ -32,16 +32,12 @@ commands = python setup.py build_sphinx
|
||||
setenv =
|
||||
{[testenv]setenv}
|
||||
TRANSPORT_DRIVER=rabbit
|
||||
amqp>=2.0.0
|
||||
kombu>=4.0.0
|
||||
commands = pifpaf run rabbitmq -- python setup.py testr --slowest --testr-args='{posargs:oslo_messaging.tests.functional}'
|
||||
|
||||
[testenv:py35-func-rabbit]
|
||||
setenv =
|
||||
{[testenv]setenv}
|
||||
TRANSPORT_DRIVER=rabbit
|
||||
amqp>=2.0.0
|
||||
kombu>=4.0.0
|
||||
basepython = python3.5
|
||||
commands = pifpaf run rabbitmq -- python setup.py testr --slowest --testr-args='{posargs:oslo_messaging.tests.functional}'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user