diff options
author | Mehdi Abaakouk <sileht@redhat.com> | 2015-12-02 09:36:02 +0100 |
---|---|---|
committer | Mehdi Abaakouk <sileht@redhat.com> | 2015-12-04 08:00:31 +0100 |
commit | 18d1708711191a8cfee479499ac066828355d47f (patch) | |
tree | 3472263898e81acd1884dd50988a56d652b4a6e9 | |
parent | d1e2fb3be6d5799225c7bbbb36d712699fab051b (diff) | |
download | oslo-messaging-18d1708711191a8cfee479499ac066828355d47f.tar.gz |
rename kombu_reconnect_timeout option
This change renames kombu_reconnect_timeout to missing_consumer_retry_timeout.
And improves its documentation.
Change-Id: I961cf96108db2f392b13d159f516baac9ff4e989
-rw-r--r-- | oslo_messaging/_drivers/impl_rabbit.py | 21 | ||||
-rw-r--r-- | oslo_messaging/tests/drivers/test_impl_rabbit.py | 6 |
2 files changed, 11 insertions, 16 deletions
diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py index cdd642e..72dd62a 100644 --- a/oslo_messaging/_drivers/impl_rabbit.py +++ b/oslo_messaging/_drivers/impl_rabbit.py @@ -73,18 +73,12 @@ rabbit_opts = [ deprecated_group='DEFAULT', help='How long to wait before reconnecting in response to an ' 'AMQP consumer cancel notification.'), - cfg.IntOpt('kombu_reconnect_timeout', - # NOTE(dhellmann): We want this to be similar to - # rpc_response_timeout, but we can't use - # "$rpc_response_timeout" as a default because that - # option may not have been defined by the time this - # option is accessed. Instead, document the intent in - # the help text for this option and provide a separate - # literal default value. + cfg.IntOpt('kombu_missing_consumer_retry_timeout', + deprecated_name="kombu_reconnect_timeout", default=60, - help='How long to wait before considering a reconnect ' - 'attempt to have failed. This value should not be ' - 'longer than rpc_response_timeout.'), + help='How long to wait a missing client beforce abandoning to ' + 'send it its replies. This value should not be longer ' + 'than rpc_response_timeout.'), cfg.StrOpt('kombu_failover_strategy', choices=('round-robin', 'shuffle'), default='round-robin', @@ -384,7 +378,8 @@ class Connection(object): self.amqp_durable_queues = driver_conf.amqp_durable_queues self.amqp_auto_delete = driver_conf.amqp_auto_delete self.rabbit_use_ssl = driver_conf.rabbit_use_ssl - self.kombu_reconnect_timeout = driver_conf.kombu_reconnect_timeout + self.kombu_missing_consumer_retry_timeout = \ + driver_conf.kombu_missing_consumer_retry_timeout self.kombu_failover_strategy = driver_conf.kombu_failover_strategy if self.rabbit_use_ssl: @@ -1134,7 +1129,7 @@ class RabbitDriver(amqpdriver.AMQPDriverBase): conf.register_opts(base.base_opts, group=opt_group) self.missing_destination_retry_timeout = ( - conf.oslo_messaging_rabbit.kombu_reconnect_timeout) + conf.oslo_messaging_rabbit.kombu_missing_consumer_retry_timeout) connection_pool = pool.ConnectionPool( conf, conf.oslo_messaging_rabbit.rpc_conn_pool_size, diff --git a/oslo_messaging/tests/drivers/test_impl_rabbit.py b/oslo_messaging/tests/drivers/test_impl_rabbit.py index 63ce066..52cbfe1 100644 --- a/oslo_messaging/tests/drivers/test_impl_rabbit.py +++ b/oslo_messaging/tests/drivers/test_impl_rabbit.py @@ -379,7 +379,7 @@ class TestSendReceive(test_utils.BaseTestCase): cls._reply_ending) def test_send_receive(self): - self.config(kombu_reconnect_timeout=0.5, + self.config(kombu_missing_consumer_retry_timeout=0.5, group="oslo_messaging_rabbit") self.config(heartbeat_timeout_threshold=0, group="oslo_messaging_rabbit") @@ -474,10 +474,10 @@ class TestSendReceive(test_utils.BaseTestCase): if self.reply_failure_404: # NOTE(sileht) all reply fail, first take - # kombu_reconnect_timeout seconds to fail + # kombu_missing_consumer_retry_timeout seconds to fail # next immediately fail dt = time.time() - start - timeout = self.conf.oslo_messaging_rabbit.kombu_reconnect_timeout + timeout = self.conf.oslo_messaging_rabbit.kombu_missing_consumer_retry_timeout self.assertTrue(timeout <= dt < (timeout + 0.100), dt) self.assertEqual(len(senders), len(replies)) |