diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py index 24baef8f8..19f73d207 100644 --- a/oslo_messaging/_drivers/impl_rabbit.py +++ b/oslo_messaging/_drivers/impl_rabbit.py @@ -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() diff --git a/requirements.txt b/requirements.txt index 8c4fe82ab..52ad22f43 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/tools/tox_install.sh b/tools/tox_install.sh index 48ccf9688..97a198da4 100755 --- a/tools/tox_install.sh +++ b/tools/tox_install.sh @@ -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 $? diff --git a/tox.ini b/tox.ini index dc4cbaf53..82ad1e916 100644 --- a/tox.ini +++ b/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}'