diff -Nru python-oslo.messaging-12.1.0/AUTHORS python-oslo.messaging-12.1.6/AUTHORS --- python-oslo.messaging-12.1.0/AUTHORS 2020-04-07 10:12:21.000000000 +0000 +++ python-oslo.messaging-12.1.6/AUTHORS 2021-03-15 10:35:41.000000000 +0000 @@ -154,6 +154,7 @@ Sean Dague Sean McGinnis Sean McGinnis +Sean Mooney Sergey Lukjanov Sergey Vilgelm Shahar Lev @@ -226,9 +227,11 @@ pengyuesheng ricolin root +shenjiatong sonu.kumar tengqm ting.wang +ushen venkatamahesh wanglmopenstack weiweigu diff -Nru python-oslo.messaging-12.1.0/bindep.txt python-oslo.messaging-12.1.6/bindep.txt --- python-oslo.messaging-12.1.0/bindep.txt 2020-04-07 10:11:11.000000000 +0000 +++ python-oslo.messaging-12.1.6/bindep.txt 2021-03-15 10:34:52.000000000 +0000 @@ -15,21 +15,22 @@ rabbitmq-server [platform:rpm rabbit] # AMQP1 dpkg -qdrouterd [platform:dpkg amqp1] -sasl2-bin [platform:dpkg amqp1] -uuid-dev [platform:dpkg amqp1] -swig [platform:dpkg amqp1] -libsasl2-modules [platform:dpkg amqp1] -openjdk-8-jdk [platform:dpkg amqp1] +# This needs qpid/testing, will be installed by tools/test-setup.sh +# qdrouterd [platform:dpkg amqp1 test] +sasl2-bin [platform:dpkg amqp1 test] +uuid-dev [platform:dpkg amqp1 test] +swig [platform:dpkg amqp1 test] +libsasl2-modules [platform:dpkg amqp1 test] +openjdk-8-jdk [platform:dpkg amqp1 test] -# AMQP1 rpm -qpid-dispatch-router [platform:rpm amqp1] -python-qpid-proton [platform:rpm amqp1] -cyrus-sasl-lib [platform:rpm amqp1] -cyrus-sasl-plain [platform:rpm amqp1] -libuuid-devel [platform:rpm amqp1] -swig [platform:rpm amqp1] -java-1.8.0-openjdk [platform:rpm amqp1] +# AMQP1 TEST rpm +qpid-dispatch-router [platform:rpm amqp1 test] +python-qpid-proton [platform:rpm amqp1 test] +cyrus-sasl-lib [platform:rpm amqp1 test] +cyrus-sasl-plain [platform:rpm amqp1 test] +libuuid-devel [platform:rpm amqp1 test] +swig [platform:rpm amqp1 test] +java-1.8.0-openjdk [platform:rpm amqp1 test] # kafka dpkg openjdk-8-jdk [platform:dpkg kafka] diff -Nru python-oslo.messaging-12.1.0/ChangeLog python-oslo.messaging-12.1.6/ChangeLog --- python-oslo.messaging-12.1.0/ChangeLog 2020-04-07 10:12:21.000000000 +0000 +++ python-oslo.messaging-12.1.6/ChangeLog 2021-03-15 10:35:41.000000000 +0000 @@ -1,6 +1,43 @@ CHANGES ======= +12.1.6 +------ + +* Correctly handle missing RabbitMQ queues +* Deprecate the mandatory flag +* Fix some typos +* Fix type of direct\_mandatory\_flag opt +* Dropping lower constraints testing + +12.1.5 +------ + +* add min of 1 to rpc\_conn\_pool\_size + +12.1.4 +------ + +* Cancel consumer if queue down + +12.1.3 +------ + +* Catch ConnectionForced Exception + +12.1.2 +------ + +* tests: Resolves issues with kombu > 4.6.8 +* Simplify tools/test-setup.sh + +12.1.1 +------ + +* Print warning message when connection running out +* Update TOX/UPPER\_CONSTRAINTS\_FILE for stable/ussuri +* Update .gitreview for stable/ussuri + 12.1.0 ------ diff -Nru python-oslo.messaging-12.1.0/debian/changelog python-oslo.messaging-12.1.6/debian/changelog --- python-oslo.messaging-12.1.0/debian/changelog 2020-04-09 18:46:55.000000000 +0000 +++ python-oslo.messaging-12.1.6/debian/changelog 2021-08-23 19:09:37.000000000 +0000 @@ -1,3 +1,17 @@ +python-oslo.messaging (12.1.6-0ubuntu1) focal; urgency=medium + + [ Corey Bryant ] + * d/gbp.conf: Create stable/ussuri branch. + + [ Chris MacNaughton ] + * d/control: Update VCS paths for move to lp:~ubuntu-openstack-dev. + + [ Corey Bryant ] + * New stable point release for OpenStack Ussuri (LP: #1940858). + * d/p/no-functional-test.patch: Rebased. + + -- Corey Bryant Mon, 23 Aug 2021 15:09:37 -0400 + python-oslo.messaging (12.1.0-0ubuntu1) focal; urgency=medium * New upstream release for OpenStack Ussuri. diff -Nru python-oslo.messaging-12.1.0/debian/control python-oslo.messaging-12.1.6/debian/control --- python-oslo.messaging-12.1.0/debian/control 2020-04-09 18:46:55.000000000 +0000 +++ python-oslo.messaging-12.1.6/debian/control 2021-08-23 19:09:37.000000000 +0000 @@ -47,8 +47,8 @@ python3-yaml (>= 3.12), subunit, Standards-Version: 4.4.1 -Vcs-Browser: https://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/python-oslo.messaging -Vcs-Git: git://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/python-oslo.messaging +Vcs-Browser: https://git.launchpad.net/~ubuntu-openstack-dev/ubuntu/+source/python-oslo.messaging +Vcs-Git: git://git.launchpad.net/~ubuntu-openstack-dev/ubuntu/+source/python-oslo.messaging Homepage: https://github.com/openstack/oslo.messaging Package: python3-oslo.messaging diff -Nru python-oslo.messaging-12.1.0/debian/gbp.conf python-oslo.messaging-12.1.6/debian/gbp.conf --- python-oslo.messaging-12.1.0/debian/gbp.conf 2020-04-09 18:46:55.000000000 +0000 +++ python-oslo.messaging-12.1.6/debian/gbp.conf 2021-08-23 19:09:37.000000000 +0000 @@ -1,5 +1,5 @@ [DEFAULT] -debian-branch = master +debian-branch = stable/ussuri upstream-tag = %(version)s pristine-tar = True diff -Nru python-oslo.messaging-12.1.0/debian/patches/no-functional-test.patch python-oslo.messaging-12.1.6/debian/patches/no-functional-test.patch --- python-oslo.messaging-12.1.0/debian/patches/no-functional-test.patch 2020-04-09 18:46:55.000000000 +0000 +++ python-oslo.messaging-12.1.6/debian/patches/no-functional-test.patch 2021-08-23 19:09:37.000000000 +0000 @@ -4,9 +4,9 @@ Forwarded: not-needed Last-Update: 2018-08-20 ---- a/oslo_messaging/tests/functional/test_rabbitmq.py 2017-09-17 21:53:44.961273588 +0000 -+++ /dev/null 2016-10-17 11:11:15.359358587 +0000 -@@ -1,129 +0,0 @@ +--- a/oslo_messaging/tests/functional/test_rabbitmq.py ++++ /dev/null +@@ -1,136 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at @@ -48,6 +48,12 @@ - ] - - def test_failover_scenario(self): +- self._test_failover_scenario() +- +- def test_failover_scenario_enable_cancel_on_failover(self): +- self._test_failover_scenario(enable_cancel_on_failover=True) +- +- def _test_failover_scenario(self, enable_cancel_on_failover=False): - # NOTE(sileht): run this test only if functional suite run of a driver - # that use rabbitmq as backend - self.driver = os.environ.get('TRANSPORT_DRIVER') @@ -62,6 +68,7 @@ - kombu_reconnect_delay=0, - rabbit_retry_interval=0, - rabbit_retry_backoff=0, +- enable_cancel_on_failover=enable_cancel_on_failover, - group='oslo_messaging_rabbit') - - self.pifpaf = self.useFixture(rabbitmq.RabbitMQDriver(cluster=True, diff -Nru python-oslo.messaging-12.1.0/doc/source/admin/rabbit.rst python-oslo.messaging-12.1.6/doc/source/admin/rabbit.rst --- python-oslo.messaging-12.1.0/doc/source/admin/rabbit.rst 2020-04-07 10:11:11.000000000 +0000 +++ python-oslo.messaging-12.1.6/doc/source/admin/rabbit.rst 2021-03-15 10:34:52.000000000 +0000 @@ -66,7 +66,8 @@ through the *Connection* class. With mandatory flag RabbitMQ raises a callback if the message is not routed to -any queue. +any queue. This callback will be used to loop for a timeout and let's a chance +to sender to recover. .. _Exchange is a AMQP mechanism: https://www.rabbitmq.com/tutorials/amqp-concepts.html#exchanges .. _queues: https://www.rabbitmq.com/queues.html diff -Nru python-oslo.messaging-12.1.0/lower-constraints.txt python-oslo.messaging-12.1.6/lower-constraints.txt --- python-oslo.messaging-12.1.0/lower-constraints.txt 2020-04-07 10:11:11.000000000 +0000 +++ python-oslo.messaging-12.1.6/lower-constraints.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -alabaster==0.7.10 -amqp==2.5.2 -appdirs==1.3.0 -Babel==2.3.4 -bandit==1.1.0 -cachetools==2.0.0 -cffi==1.7.0 -cliff==2.8.0 -cmd2==0.8.0 -confluent-kafka==0.11.6 -contextlib2==0.4.0 -coverage==4.0 -debtcollector==1.2.0 -docutils==0.11 -dulwich==0.15.0 -eventlet==0.18.2 -extras==1.0.0 -fasteners==0.7.0 -fixtures==3.0.0 -flake8==2.5.5 -futurist==1.2.0 -gitdb==0.6.4 -GitPython==1.0.1 -greenlet==0.4.10 -hacking==0.12.0 -imagesize==0.7.1 -iso8601==0.1.11 -Jinja2==2.10 -keystoneauth1==3.4.0 -kombu==4.6.6 -linecache2==1.0.0 -MarkupSafe==1.0 -mccabe==0.2.1 -mock==2.0.0 -monotonic==0.6 -mox3==0.20.0 -msgpack-python==0.4.0 -netaddr==0.7.18 -netifaces==0.10.4 -openstackdocstheme==1.20.0 -os-client-config==1.28.0 -oslo.concurrency==3.25.0 -oslo.config==5.2.0 -oslo.context==2.19.2 -oslo.i18n==3.15.3 -oslo.log==3.36.0 -oslo.middleware==3.31.0 -oslo.serialization==2.18.0 -oslo.service==1.24.0 -oslo.utils==3.37.0 -oslotest==3.2.0 -Paste==2.0.2 -PasteDeploy==1.5.0 -pbr==2.0.0 -pep8==1.5.7 -pifpaf==2.2.0 -prettytable==0.7.2 -pycparser==2.18 -pyflakes==0.8.1 -Pygments==2.2.0 -pyinotify==0.9.6 -pyngus==2.2.0 -pyparsing==2.1.0 -pyperclip==1.5.27 -python-dateutil==2.5.3 -python-mimeparse==1.6.0 -python-qpid-proton==0.17.0 -python-subunit==1.0.0 -pytz==2013.6 -PyYAML==3.12 -reno==2.5.0 -repoze.lru==0.7 -requests==2.14.2 -requestsexceptions==1.2.0 -rfc3986==0.3.1 -Routes==2.3.1 -six==1.10.0 -smmap==0.9.0 -snowballstemmer==1.2.1 -Sphinx==1.8.0 -sphinxcontrib-websupport==1.0.1 -statsd==3.2.1 -stestr==2.0.0 -stevedore==1.20.0 -tenacity==4.4.0 -testscenarios==0.4 -testtools==2.2.0 -traceback2==1.4.0 -unittest2==1.1.0 -vine==1.1.4 -WebOb==1.7.1 -wrapt==1.7.0 -xattr==0.9.2 diff -Nru python-oslo.messaging-12.1.0/oslo_messaging/_drivers/amqpdriver.py python-oslo.messaging-12.1.6/oslo_messaging/_drivers/amqpdriver.py --- python-oslo.messaging-12.1.0/oslo_messaging/_drivers/amqpdriver.py 2020-04-07 10:11:11.000000000 +0000 +++ python-oslo.messaging-12.1.6/oslo_messaging/_drivers/amqpdriver.py 2021-03-15 10:34:52.000000000 +0000 @@ -145,39 +145,67 @@ while True: try: with self.listener.driver._get_connection( - rpc_common.PURPOSE_SEND) as conn: + rpc_common.PURPOSE_SEND, + ) as conn: self._send_reply(conn, reply, failure) + return - except rpc_amqp.AMQPDestinationNotFound: - if timer.check_return() > 0: - LOG.debug(("The reply %(msg_id)s cannot be sent " - "%(reply_q)s reply queue don't exist, " - "retrying..."), { - 'msg_id': self.msg_id, - 'reply_q': self.reply_q}) - time.sleep(0.25) - else: + except oslo_messaging.MessageUndeliverable: + # queue not found + if timer.check_return() <= 0: self._obsolete_reply_queues.add(self.reply_q, self.msg_id) - infos = { + LOG.error( + 'The reply %(msg_id)s failed to send after ' + '%(duration)d seconds due to a missing queue ' + '(%(reply_q)s). Abandoning...', { + 'msg_id': self.msg_id, + 'duration': duration, + 'reply_q': self.reply_q}) + return + + LOG.debug( + 'The reply %(msg_id)s could not be sent due to a missing ' + 'queue (%(reply_q)s). Retrying...', { 'msg_id': self.msg_id, - 'reply_q': self.reply_q, - 'duration': duration - } - LOG.info("The reply %(msg_id)s cannot be sent " - "%(reply_q)s reply queue don't exist after " - "%(duration)s sec abandoning...", infos) + 'reply_q': self.reply_q}) + time.sleep(0.25) + except rpc_amqp.AMQPDestinationNotFound as exc: + # exchange not found/down + if timer.check_return() <= 0: + self._obsolete_reply_queues.add(self.reply_q, self.msg_id) + LOG.error( + 'The reply %(msg_id)s failed to send after ' + '%(duration)d seconds due to a broker issue ' + '(%(exc)s). Abandoning...', { + 'msg_id': self.msg_id, + 'duration': duration, + 'exc': exc}) return + LOG.debug( + 'The reply %(msg_id)s could not be sent due to a broker ' + 'issue (%(exc)s). Retrying...', { + 'msg_id': self.msg_id, + 'exc': exc}) + time.sleep(0.25) + def heartbeat(self): # generate a keep alive for RPC call monitoring with self.listener.driver._get_connection( - rpc_common.PURPOSE_SEND) as conn: + rpc_common.PURPOSE_SEND, + ) as conn: try: self._send_reply(conn, None, None, ending=False) + except oslo_messaging.MessageUndeliverable: + # internal exception that indicates queue gone - + # broker unreachable. + raise MessageDeliveryFailure( + "Heartbeat send failed. Missing queue") except rpc_amqp.AMQPDestinationNotFound: - # internal exception that indicates queue/exchange gone - + # internal exception that indicates exchange gone - # broker unreachable. - raise MessageDeliveryFailure("Heartbeat send failed") + raise MessageDeliveryFailure( + "Heartbeat send failed. Missing exchange") # NOTE(sileht): Those have already be ack in RpcListener IO thread # We keep them as noop until all drivers do the same @@ -220,7 +248,7 @@ class ObsoleteReplyQueuesCache(object): - """Cache of reply queue id that doesn't exists anymore. + """Cache of reply queue id that doesn't exist anymore. NOTE(sileht): In case of a broker restart/failover a reply queue can be unreachable for short period @@ -259,7 +287,7 @@ self._no_reply_log(reply_q, msg_id) def _no_reply_log(self, reply_q, msg_id): - LOG.warning("%(reply_queue)s doesn't exists, drop reply to " + LOG.warning("%(reply_queue)s doesn't exist, drop reply to " "%(msg_id)s", {'reply_queue': reply_q, "msg_id": msg_id}) diff -Nru python-oslo.messaging-12.1.0/oslo_messaging/_drivers/base.py python-oslo.messaging-12.1.6/oslo_messaging/_drivers/base.py --- python-oslo.messaging-12.1.0/oslo_messaging/_drivers/base.py 2020-04-07 10:11:11.000000000 +0000 +++ python-oslo.messaging-12.1.6/oslo_messaging/_drivers/base.py 2021-03-15 10:34:52.000000000 +0000 @@ -25,7 +25,8 @@ base_opts = [ cfg.IntOpt('rpc_conn_pool_size', default=30, deprecated_group='DEFAULT', - help='Size of RPC connection pool.'), + help='Size of RPC connection pool.', + min=1), cfg.IntOpt('conn_pool_min_size', default=2, help='The pool size limit for connections expiration policy'), cfg.IntOpt('conn_pool_ttl', default=1200, diff -Nru python-oslo.messaging-12.1.0/oslo_messaging/_drivers/impl_rabbit.py python-oslo.messaging-12.1.6/oslo_messaging/_drivers/impl_rabbit.py --- python-oslo.messaging-12.1.0/oslo_messaging/_drivers/impl_rabbit.py 2020-04-07 10:11:11.000000000 +0000 +++ python-oslo.messaging-12.1.6/oslo_messaging/_drivers/impl_rabbit.py 2021-03-15 10:34:52.000000000 +0000 @@ -26,6 +26,7 @@ import time import uuid +from amqp import exceptions as amqp_exec import kombu import kombu.connection import kombu.entity @@ -59,7 +60,7 @@ # we will facing an issue by trying to override the threading module. stdlib_threading = threading -# NOTE(sileht): don't exists in py2 socket module +# NOTE(sileht): don't exist in py2 socket module TCP_USER_TIMEOUT = 18 rabbit_opts = [ @@ -168,12 +169,23 @@ default=2, help='How often times during the heartbeat_timeout_threshold ' 'we check the heartbeat.'), - cfg.IntOpt('direct_mandatory_flag', - default=True, - help='Enable/Disable the RabbitMQ mandatory flag ' - 'for direct send. The direct send is used as reply, ' - 'so the MessageUndeliverable exception is raised ' - 'in case the client queue does not exist.'), + cfg.BoolOpt('direct_mandatory_flag', + default=True, + deprecated_for_removal=True, + deprecated_reason='Mandatory flag no longer deactivable.', + help='(DEPRECATED) Enable/Disable the RabbitMQ mandatory ' + 'flag for direct send. The direct send is used as reply, ' + 'so the MessageUndeliverable exception is raised ' + 'in case the client queue does not exist.' + 'MessageUndeliverable exception will be used to loop for a ' + 'timeout to lets a chance to sender to recover.' + 'This flag is deprecated and it will not be possible to ' + 'deactivate this functionality anymore'), + cfg.BoolOpt('enable_cancel_on_failover', + default=False, + help="Enable x-cancel-on-ha-failover flag so that " + "rabbitmq server will cancel and notify consumers" + "when queue is down") ] LOG = logging.getLogger(__name__) @@ -235,7 +247,8 @@ def __init__(self, exchange_name, queue_name, routing_key, type, durable, exchange_auto_delete, queue_auto_delete, callback, - nowait=False, rabbit_ha_queues=None, rabbit_queue_ttl=0): + nowait=False, rabbit_ha_queues=None, rabbit_queue_ttl=0, + enable_cancel_on_failover=False): """Init the Consumer class with the exchange_name, routing_key, type, durable auto_delete """ @@ -257,10 +270,16 @@ type=type, durable=self.durable, auto_delete=self.exchange_auto_delete) + self.enable_cancel_on_failover = enable_cancel_on_failover def declare(self, conn): """Re-declare the queue after a rabbit (re)connect.""" + consumer_arguments = None + if self.enable_cancel_on_failover: + consumer_arguments = { + "x-cancel-on-ha-failover": True} + self.queue = kombu.entity.Queue( name=self.queue_name, channel=conn.channel, @@ -268,7 +287,9 @@ durable=self.durable, auto_delete=self.queue_auto_delete, routing_key=self.routing_key, - queue_arguments=self.queue_arguments) + queue_arguments=self.queue_arguments, + consumer_arguments=consumer_arguments + ) try: LOG.debug('[%s] Queue.declare: %s', @@ -469,6 +490,7 @@ self.kombu_failover_strategy = driver_conf.kombu_failover_strategy self.kombu_compression = driver_conf.kombu_compression self.heartbeat_in_pthread = driver_conf.heartbeat_in_pthread + self.enable_cancel_on_failover = driver_conf.enable_cancel_on_failover if self.heartbeat_in_pthread: # NOTE(hberaud): Experimental: threading module is in use to run @@ -496,6 +518,7 @@ # if it was already monkey patched by eventlet/greenlet. global threading threading = stdlib_threading + self.direct_mandatory_flag = driver_conf.direct_mandatory_flag if self.ssl: @@ -1012,7 +1035,8 @@ except (socket.timeout, ConnectRefuseError, OSError, - kombu.exceptions.OperationalError) as exc: + kombu.exceptions.OperationalError, + amqp_exec.ConnectionForced) as exc: LOG.info("A recoverable connection/channel error " "occurred, trying to reconnect: %s", exc) self.ensure_connection() @@ -1118,31 +1142,35 @@ responses for call/multicall """ - consumer = Consumer(exchange_name='', # using default exchange - queue_name=topic, - routing_key='', - type='direct', - durable=False, - exchange_auto_delete=False, - queue_auto_delete=False, - callback=callback, - rabbit_ha_queues=self.rabbit_ha_queues, - rabbit_queue_ttl=self.rabbit_transient_queues_ttl) + consumer = Consumer( + exchange_name='', # using default exchange + queue_name=topic, + routing_key='', + type='direct', + durable=False, + exchange_auto_delete=False, + queue_auto_delete=False, + callback=callback, + rabbit_ha_queues=self.rabbit_ha_queues, + rabbit_queue_ttl=self.rabbit_transient_queues_ttl, + enable_cancel_on_failover=self.enable_cancel_on_failover) self.declare_consumer(consumer) def declare_topic_consumer(self, exchange_name, topic, callback=None, queue_name=None): """Create a 'topic' consumer.""" - consumer = Consumer(exchange_name=exchange_name, - queue_name=queue_name or topic, - routing_key=topic, - type='topic', - durable=self.amqp_durable_queues, - exchange_auto_delete=self.amqp_auto_delete, - queue_auto_delete=self.amqp_auto_delete, - callback=callback, - rabbit_ha_queues=self.rabbit_ha_queues) + consumer = Consumer( + exchange_name=exchange_name, + queue_name=queue_name or topic, + routing_key=topic, + type='topic', + durable=self.amqp_durable_queues, + exchange_auto_delete=self.amqp_auto_delete, + queue_auto_delete=self.amqp_auto_delete, + callback=callback, + rabbit_ha_queues=self.rabbit_ha_queues, + enable_cancel_on_failover=self.enable_cancel_on_failover) self.declare_consumer(consumer) @@ -1153,16 +1181,18 @@ exchange_name = '%s_fanout' % topic queue_name = '%s_fanout_%s' % (topic, unique) - consumer = Consumer(exchange_name=exchange_name, - queue_name=queue_name, - routing_key=topic, - type='fanout', - durable=False, - exchange_auto_delete=True, - queue_auto_delete=False, - callback=callback, - rabbit_ha_queues=self.rabbit_ha_queues, - rabbit_queue_ttl=self.rabbit_transient_queues_ttl) + consumer = Consumer( + exchange_name=exchange_name, + queue_name=queue_name, + routing_key=topic, + type='fanout', + durable=False, + exchange_auto_delete=True, + queue_auto_delete=False, + callback=callback, + rabbit_ha_queues=self.rabbit_ha_queues, + rabbit_queue_ttl=self.rabbit_transient_queues_ttl, + enable_cancel_on_failover=self.enable_cancel_on_failover) self.declare_consumer(consumer) @@ -1286,7 +1316,7 @@ # the 404 kombu ChannelError and retry until the exchange # appears raise rpc_amqp.AMQPDestinationNotFound( - "exchange %s doesn't exists" % exchange.name) + "exchange %s doesn't exist" % exchange.name) raise def direct_send(self, msg_id, msg): @@ -1368,6 +1398,10 @@ # the pool configuration properties max_size = conf.oslo_messaging_rabbit.rpc_conn_pool_size min_size = conf.oslo_messaging_rabbit.conn_pool_min_size + if max_size < min_size: + raise RuntimeError( + f"rpc_conn_pool_size: {max_size} must be greater than " + f"or equal to conn_pool_min_size: {min_size}") ttl = conf.oslo_messaging_rabbit.conn_pool_ttl connection_pool = pool.ConnectionPool( diff -Nru python-oslo.messaging-12.1.0/oslo_messaging/_drivers/pool.py python-oslo.messaging-12.1.6/oslo_messaging/_drivers/pool.py --- python-oslo.messaging-12.1.0/oslo_messaging/_drivers/pool.py 2020-04-07 10:11:11.000000000 +0000 +++ python-oslo.messaging-12.1.6/oslo_messaging/_drivers/pool.py 2021-03-15 10:34:52.000000000 +0000 @@ -100,6 +100,10 @@ self._current_size += 1 break + LOG.warning("Connection pool limit exceeded: " + "current size %s surpasses max " + "configured rpc_conn_pool_size %s", + self._current_size, self._max_size) wait_condition(self._cond) # We've grabbed a slot and dropped the lock, now do the creation diff -Nru python-oslo.messaging-12.1.0/oslo_messaging/tests/drivers/test_impl_rabbit.py python-oslo.messaging-12.1.6/oslo_messaging/tests/drivers/test_impl_rabbit.py --- python-oslo.messaging-12.1.0/oslo_messaging/tests/drivers/test_impl_rabbit.py 2020-04-07 10:11:11.000000000 +0000 +++ python-oslo.messaging-12.1.6/oslo_messaging/tests/drivers/test_impl_rabbit.py 2021-03-15 10:34:52.000000000 +0000 @@ -21,6 +21,7 @@ import fixtures import kombu +import kombu.connection import kombu.transport.memory from oslo_serialization import jsonutils from oslo_utils import eventletutils @@ -32,6 +33,7 @@ from oslo_messaging._drivers import impl_rabbit as rabbit_driver from oslo_messaging.exceptions import MessageDeliveryFailure from oslo_messaging.tests import utils as test_utils +from oslo_messaging.transport import DriverLoadFailure from six.moves import mock load_tests = testscenarios.load_tests_apply_scenarios @@ -142,6 +144,20 @@ self.assertIsInstance(driver, rabbit_driver.RabbitDriver) + @mock.patch('oslo_messaging._drivers.impl_rabbit.Connection' + '.ensure_connection') + @mock.patch('oslo_messaging._drivers.impl_rabbit.Connection.reset') + def test_driver_load_max_less_than_min(self, fake_ensure, fake_reset): + self.config( + rpc_conn_pool_size=1, conn_pool_min_size=2, + group='oslo_messaging_rabbit') + self.messaging_conf.transport_url = self.transport_url + error = self.assertRaises( + DriverLoadFailure, oslo_messaging.get_transport, self.conf) + self.assertIn( + "rpc_conn_pool_size: 1 must be greater than or equal " + "to conn_pool_min_size: 2", str(error)) + class TestRabbitDriverLoadSSL(test_utils.BaseTestCase): scenarios = [ @@ -972,13 +988,19 @@ 'kombu.connection.Connection.connection')) self.useFixture(fixtures.MockPatch( 'kombu.connection.Connection.channel')) + # TODO(stephenfin): Drop hasattr when we drop support for kombo < 4.6.8 + if hasattr(kombu.connection.Connection, '_connection_factory'): + self.useFixture(fixtures.MockPatch( + 'kombu.connection.Connection._connection_factory')) # starting from the first broker in the list url = oslo_messaging.TransportURL.parse(self.conf, None) self.connection = rabbit_driver.Connection(self.conf, url, driver_common.PURPOSE_SEND) - self.useFixture(fixtures.MockPatch( - 'kombu.connection.Connection.connect')) + # TODO(stephenfin): Remove when we drop support for kombo < 4.6.8 + if hasattr(kombu.connection.Connection, 'connect'): + self.useFixture(fixtures.MockPatch( + 'kombu.connection.Connection.connect')) self.addCleanup(self.connection.close) def test_ensure_four_retry(self): diff -Nru python-oslo.messaging-12.1.0/oslo_messaging/tests/functional/test_rabbitmq.py python-oslo.messaging-12.1.6/oslo_messaging/tests/functional/test_rabbitmq.py --- python-oslo.messaging-12.1.0/oslo_messaging/tests/functional/test_rabbitmq.py 2020-04-07 10:11:11.000000000 +0000 +++ python-oslo.messaging-12.1.6/oslo_messaging/tests/functional/test_rabbitmq.py 2021-03-15 10:34:52.000000000 +0000 @@ -39,6 +39,12 @@ ] def test_failover_scenario(self): + self._test_failover_scenario() + + def test_failover_scenario_enable_cancel_on_failover(self): + self._test_failover_scenario(enable_cancel_on_failover=True) + + def _test_failover_scenario(self, enable_cancel_on_failover=False): # NOTE(sileht): run this test only if functional suite run of a driver # that use rabbitmq as backend self.driver = os.environ.get('TRANSPORT_DRIVER') @@ -53,6 +59,7 @@ kombu_reconnect_delay=0, rabbit_retry_interval=0, rabbit_retry_backoff=0, + enable_cancel_on_failover=enable_cancel_on_failover, group='oslo_messaging_rabbit') self.pifpaf = self.useFixture(rabbitmq.RabbitMQDriver(cluster=True, diff -Nru python-oslo.messaging-12.1.0/oslo.messaging.egg-info/pbr.json python-oslo.messaging-12.1.6/oslo.messaging.egg-info/pbr.json --- python-oslo.messaging-12.1.0/oslo.messaging.egg-info/pbr.json 2020-04-07 10:12:21.000000000 +0000 +++ python-oslo.messaging-12.1.6/oslo.messaging.egg-info/pbr.json 2021-03-15 10:35:41.000000000 +0000 @@ -1 +1 @@ -{"git_version": "7f638bb4", "is_release": true} \ No newline at end of file +{"git_version": "36b5e06c", "is_release": true} \ No newline at end of file diff -Nru python-oslo.messaging-12.1.0/oslo.messaging.egg-info/PKG-INFO python-oslo.messaging-12.1.6/oslo.messaging.egg-info/PKG-INFO --- python-oslo.messaging-12.1.0/oslo.messaging.egg-info/PKG-INFO 2020-04-07 10:12:21.000000000 +0000 +++ python-oslo.messaging-12.1.6/oslo.messaging.egg-info/PKG-INFO 2021-03-15 10:35:41.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: oslo.messaging -Version: 12.1.0 +Version: 12.1.6 Summary: Oslo Messaging API Home-page: https://docs.openstack.org/oslo.messaging/latest/ Author: OpenStack diff -Nru python-oslo.messaging-12.1.0/oslo.messaging.egg-info/requires.txt python-oslo.messaging-12.1.6/oslo.messaging.egg-info/requires.txt --- python-oslo.messaging-12.1.0/oslo.messaging.egg-info/requires.txt 2020-04-07 10:12:21.000000000 +0000 +++ python-oslo.messaging-12.1.6/oslo.messaging.egg-info/requires.txt 2021-03-15 10:35:41.000000000 +0000 @@ -1,19 +1,19 @@ -pbr!=2.1.0,>=2.0.0 +PyYAML>=3.12 +WebOb>=1.7.1 +amqp>=2.5.2 +cachetools>=2.0.0 +debtcollector>=1.2.0 futurist>=1.2.0 +kombu>=4.6.6 oslo.config>=5.2.0 oslo.log>=3.36.0 -oslo.utils>=3.37.0 +oslo.middleware>=3.31.0 oslo.serialization!=2.19.1,>=2.18.0 oslo.service!=1.28.1,>=1.24.0 -stevedore>=1.20.0 -debtcollector>=1.2.0 +oslo.utils>=3.37.0 +pbr!=2.1.0,>=2.0.0 six>=1.10.0 -cachetools>=2.0.0 -WebOb>=1.7.1 -PyYAML>=3.12 -amqp>=2.5.2 -kombu>=4.6.6 -oslo.middleware>=3.31.0 +stevedore>=1.20.0 [:(python_version<'3.3')] monotonic>=0.6 @@ -25,17 +25,17 @@ confluent-kafka>=0.11.6 [test] -hacking<3.1.0,>=3.0 +bandit<1.6.0,>=1.1.0 +confluent-kafka>=0.11.6 +coverage!=4.4,>=4.0 +eventlet!=0.18.3,!=0.20.1,>=0.18.2 fixtures>=3.0.0 +greenlet>=0.4.10 +hacking<3.1.0,>=3.0 mock>=2.0.0 -stestr>=2.0.0 -testscenarios>=0.4 -testtools>=2.2.0 oslotest>=3.2.0 pifpaf>=2.2.0 -confluent-kafka>=0.11.6 -coverage!=4.4,>=4.0 pyngus>=2.2.0 -bandit<1.6.0,>=1.1.0 -eventlet!=0.18.3,!=0.20.1,>=0.18.2 -greenlet>=0.4.10 +stestr>=2.0.0 +testscenarios>=0.4 +testtools>=2.2.0 diff -Nru python-oslo.messaging-12.1.0/oslo.messaging.egg-info/SOURCES.txt python-oslo.messaging-12.1.6/oslo.messaging.egg-info/SOURCES.txt --- python-oslo.messaging-12.1.0/oslo.messaging.egg-info/SOURCES.txt 2020-04-07 10:12:21.000000000 +0000 +++ python-oslo.messaging-12.1.6/oslo.messaging.egg-info/SOURCES.txt 2021-03-15 10:35:41.000000000 +0000 @@ -9,7 +9,6 @@ README.rst babel.cfg bindep.txt -lower-constraints.txt requirements.txt setup.cfg setup.py @@ -143,6 +142,7 @@ playbooks/oslo.messaging-telemetry-dsvm-integration-kafka/post.yaml playbooks/oslo.messaging-telemetry-dsvm-integration-rabbit/post.yaml releasenotes/notes/RPC-call-monitoring-7977f047d069769a.yaml +releasenotes/notes/add-enable_cancel_on_failover-22ac472b93dd3a23.yaml releasenotes/notes/add-ssl-support-for-kafka.yaml releasenotes/notes/add_reno-3b4ae0789e9c45b4.yaml releasenotes/notes/blocking-executor-deprecated-895146c1c3bf2f51.yaml @@ -150,9 +150,11 @@ releasenotes/notes/bump-amqp-version-due-to-tls-issue-e877b152eb101c15.yaml releasenotes/notes/connection_ttl-2cf0fe6e1ab8c73c.yaml releasenotes/notes/deprecate-ZeroMQ-driver-a8af25aaba867c5b.yaml +releasenotes/notes/disable-mandatory-flag-a6210a534f3853f0.yaml releasenotes/notes/drop-python27-support-5ef2f365d8930483.yaml releasenotes/notes/fix-access_policy-deafult-a6954a147cb002b0.yaml releasenotes/notes/get_rpc_transport-4aa3511ad9754a60.yaml +releasenotes/notes/handle-missing-queue-553a803f94976be7.yaml releasenotes/notes/kafka-client-library-change-fe16d5a34550db7f.yaml releasenotes/notes/no-log-if-ignore-errors-e2223b8a646b4c40.yaml releasenotes/notes/option-rabbitmq-max_retries-has-been-deprecated-471f66a9e6d672a2.yaml diff -Nru python-oslo.messaging-12.1.0/PKG-INFO python-oslo.messaging-12.1.6/PKG-INFO --- python-oslo.messaging-12.1.0/PKG-INFO 2020-04-07 10:12:22.000000000 +0000 +++ python-oslo.messaging-12.1.6/PKG-INFO 2021-03-15 10:35:41.476327200 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: oslo.messaging -Version: 12.1.0 +Version: 12.1.6 Summary: Oslo Messaging API Home-page: https://docs.openstack.org/oslo.messaging/latest/ Author: OpenStack diff -Nru python-oslo.messaging-12.1.0/releasenotes/notes/add-enable_cancel_on_failover-22ac472b93dd3a23.yaml python-oslo.messaging-12.1.6/releasenotes/notes/add-enable_cancel_on_failover-22ac472b93dd3a23.yaml --- python-oslo.messaging-12.1.0/releasenotes/notes/add-enable_cancel_on_failover-22ac472b93dd3a23.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-oslo.messaging-12.1.6/releasenotes/notes/add-enable_cancel_on_failover-22ac472b93dd3a23.yaml 2021-03-15 10:34:52.000000000 +0000 @@ -0,0 +1,6 @@ +--- +fixes: + - | + Add a new option `enable_cancel_on_failover` for rabbitmq driver + which when enabled, will cancel consumers when queue appears + to be down. diff -Nru python-oslo.messaging-12.1.0/releasenotes/notes/disable-mandatory-flag-a6210a534f3853f0.yaml python-oslo.messaging-12.1.6/releasenotes/notes/disable-mandatory-flag-a6210a534f3853f0.yaml --- python-oslo.messaging-12.1.0/releasenotes/notes/disable-mandatory-flag-a6210a534f3853f0.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-oslo.messaging-12.1.6/releasenotes/notes/disable-mandatory-flag-a6210a534f3853f0.yaml 2021-03-15 10:34:52.000000000 +0000 @@ -0,0 +1,5 @@ +--- +upgrade: + - | + Deprecating the ``direct_mandatory_flag``. It will not be possible to + deactivate this functionality anymore. diff -Nru python-oslo.messaging-12.1.0/releasenotes/notes/handle-missing-queue-553a803f94976be7.yaml python-oslo.messaging-12.1.6/releasenotes/notes/handle-missing-queue-553a803f94976be7.yaml --- python-oslo.messaging-12.1.0/releasenotes/notes/handle-missing-queue-553a803f94976be7.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-oslo.messaging-12.1.6/releasenotes/notes/handle-missing-queue-553a803f94976be7.yaml 2021-03-15 10:34:52.000000000 +0000 @@ -0,0 +1,5 @@ +--- +features: + - | + Adding retry strategy based on the mandatory flag. Missing exchanges and + queues are now identified separately for logging purposes. diff -Nru python-oslo.messaging-12.1.0/tools/test-setup.sh python-oslo.messaging-12.1.6/tools/test-setup.sh --- python-oslo.messaging-12.1.0/tools/test-setup.sh 2020-04-07 10:11:11.000000000 +0000 +++ python-oslo.messaging-12.1.6/tools/test-setup.sh 2021-03-15 10:34:52.000000000 +0000 @@ -6,21 +6,9 @@ # This setup for amqp1 needs to be run by a user that can run sudo. -function is_fedora { - [ -f /usr/bin/yum ] && cat /etc/*release | grep -q -e "Fedora" -} - -# NOTE(sileht): we create the virtualenv only and use bindep directly -# because tox doesn't have a quiet option... -tox -ebindep --notest - -# TODO(ansmith) for now setup amqp1 dependencies for any profile. -# Fix this when test-setup is passed environment profile setting. - -# NOTE(sileht): bindep return 1 if some packages have to be installed -PACKAGES="$(.tox/bindep/bin/bindep -b -f bindep.txt amqp1 || true)" - -[ -n "$PACKAGES" ] || exit 0 +# qdrouterd needs to be installed from qpid/testing repo in Ubuntu. +# bindep does not allow setting up another repo, so we just install +# this package here. # inspired from project-config install-distro-packages.sh if apt-get -v >/dev/null 2>&1 ; then @@ -28,11 +16,5 @@ sudo apt-get -qq update sudo PATH=/usr/sbin:/sbin:$PATH DEBIAN_FRONTEND=noninteractive \ apt-get -q --option "Dpkg::Options::=--force-confold" \ - --assume-yes install $PACKAGES -elif emerge --version >/dev/null 2>&1 ; then - sudo emerge -uDNq --jobs=4 @world - sudo PATH=/usr/sbin:/sbin:$PATH emerge -q --jobs=4 $PACKAGES -else - is_fedora && YUM=dnf || YUM=yum - sudo PATH=/usr/sbin:/sbin:$PATH $YUM install -y $PACKAGES + --assume-yes install qdrouterd fi diff -Nru python-oslo.messaging-12.1.0/tox.ini python-oslo.messaging-12.1.6/tox.ini --- python-oslo.messaging-12.1.0/tox.ini 2020-04-07 10:11:11.000000000 +0000 +++ python-oslo.messaging-12.1.6/tox.ini 2021-03-15 10:34:52.000000000 +0000 @@ -12,7 +12,7 @@ REQUIREMENTS_PIP_LOCATION install_command = pip install {opts} {packages} deps = - -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/ussuri} -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt commands = stestr run --slowest {posargs} @@ -120,9 +120,3 @@ [testenv:bindep] deps = bindep commands = bindep {posargs} - -[testenv:lower-constraints] -deps = - -c{toxinidir}/lower-constraints.txt - -r{toxinidir}/test-requirements.txt - -r{toxinidir}/requirements.txt diff -Nru python-oslo.messaging-12.1.0/.zuul.yaml python-oslo.messaging-12.1.6/.zuul.yaml --- python-oslo.messaging-12.1.0/.zuul.yaml 2020-04-07 10:11:11.000000000 +0000 +++ python-oslo.messaging-12.1.6/.zuul.yaml 2021-03-15 10:34:52.000000000 +0000 @@ -10,21 +10,21 @@ parent: openstack-tox-py36 vars: tox_envlist: py36-func-scenario02 - bindep_profile: rabbit kafka + bindep_profile: rabbit kafka amqp1 - job: name: oslo.messaging-tox-py36-func-scenario03 parent: openstack-tox-py36 vars: tox_envlist: py36-func-scenario03 - bindep_profile: rabbit + bindep_profile: rabbit amqp1 - job: name: oslo.messaging-tox-py36-func-scenario04 parent: openstack-tox-py36 vars: tox_envlist: py36-func-scenario04 - bindep_profile: kafka + bindep_profile: kafka amqp1 # Begin v3 native jobs # See https://docs.openstack.org/devstack/latest/ @@ -121,7 +121,6 @@ - check-requirements - lib-forward-testing-python3 - openstack-cover-jobs - - openstack-lower-constraints-jobs - openstack-python3-ussuri-jobs - periodic-stable-jobs - publish-openstack-docs-pti