From bf53c32dc8da12b0a6de4d4ea33cf68f1a0ef31e Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Fri, 17 Apr 2015 17:37:34 +0200 Subject: [PATCH] Disable and mark heartbeat as experimental Due to some discovered issues since heartbeat is enabled by default. Specially #1436788, that needs to fix the underlying library, too. So, according to the discution here: https://bugs.launchpad.net/oslo.messaging/+bug/1436769/comments/10 We decide to mark the implementation as experimental and disable it by default. Related-bug: #1436788 Related-bug: #1436769 Change-Id: Ib7c55977f976bdbbc8df4ad5915e0433cbf84a17 (cherry picked from commit 287a4f56f45ed9cd40116a9e7b6e529f3382a925) Bug-ES #11206 http://192.168.15.2/issues/11206 --- oslo/messaging/_drivers/impl_rabbit.py | 4 ++-- tests/drivers/test_impl_rabbit.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/oslo/messaging/_drivers/impl_rabbit.py b/oslo/messaging/_drivers/impl_rabbit.py index 0073a28a9..95d1ea294 100644 --- a/oslo/messaging/_drivers/impl_rabbit.py +++ b/oslo/messaging/_drivers/impl_rabbit.py @@ -102,10 +102,10 @@ 'If you change this option, you must wipe the ' 'RabbitMQ database.'), cfg.IntOpt('heartbeat_timeout_threshold', - default=60, + default=0, help="Number of seconds after which the Rabbit broker is " "considered down if heartbeat's keep-alive fails " - "(0 disable the heartbeat)."), + "(0 disable the heartbeat). EXPERIMENTAL"), cfg.IntOpt('heartbeat_rate', default=2, help='How often times during the heartbeat_timeout_threshold ' diff --git a/tests/drivers/test_impl_rabbit.py b/tests/drivers/test_impl_rabbit.py index c43288a30..09849b945 100644 --- a/tests/drivers/test_impl_rabbit.py +++ b/tests/drivers/test_impl_rabbit.py @@ -59,6 +59,11 @@ def test_driver_load(self): class TestHeartbeat(test_utils.BaseTestCase): + def setUp(self): + super(TestHeartbeat, self).setUp(conf=cfg.ConfigOpts()) + self.config(heartbeat_timeout_threshold=60, + group='oslo_messaging_rabbit') + @mock.patch('oslo.messaging._drivers.impl_rabbit.LOG') @mock.patch('kombu.connection.Connection.heartbeat_check') @mock.patch('oslo.messaging._drivers.impl_rabbit.Connection.' @@ -154,7 +159,7 @@ def test_driver_load(self, connection_klass, fake_ensure): transport._driver._get_connection() connection_klass.assert_called_once_with( 'memory:///', ssl=self.expected, login_method='AMQPLAIN', - heartbeat=60, failover_strategy="shuffle") + heartbeat=0, failover_strategy="shuffle") class TestRabbitIterconsume(test_utils.BaseTestCase):