diff -Nru oslo.messaging-1.8.3/debian/changelog oslo.messaging-1.8.3/debian/changelog --- oslo.messaging-1.8.3/debian/changelog 2015-06-23 07:28:03.000000000 -0700 +++ oslo.messaging-1.8.3/debian/changelog 2015-06-24 23:17:58.000000000 -0700 @@ -1,3 +1,13 @@ +oslo.messaging (1.8.3-0ubuntu0.15.04.2) vivid; urgency=medium + + * Detect when underlying kombu connection to rabbitmq server has been + disconnected and allow oslo.messaging to go through the reconnect + logic (LP: #1448650) + - d/p/redeclare-consumers-when-ack-requeue-fails.patch: redeclare consumers + when ack/requeue fails. + + -- Billy Olsen Wed, 24 Jun 2015 22:24:19 -0700 + oslo.messaging (1.8.3-0ubuntu0.15.04.1) vivid; urgency=medium * New upstream point release (LP: #1467959): diff -Nru oslo.messaging-1.8.3/debian/patches/redeclare-consumers-when-ack-requeue-fails.patch oslo.messaging-1.8.3/debian/patches/redeclare-consumers-when-ack-requeue-fails.patch --- oslo.messaging-1.8.3/debian/patches/redeclare-consumers-when-ack-requeue-fails.patch 1969-12-31 17:00:00.000000000 -0700 +++ oslo.messaging-1.8.3/debian/patches/redeclare-consumers-when-ack-requeue-fails.patch 2015-06-24 23:17:34.000000000 -0700 @@ -0,0 +1,75 @@ +From f201314484930071ee9fb8b93174f938e58c4e26 Mon Sep 17 00:00:00 2001 +From: Mehdi Abaakouk +Date: Tue, 5 May 2015 10:29:22 +0200 +Subject: [PATCH 1/1] rabbit: redeclare consumers when ack/requeue fail + +In case the acknowledgement or requeue of a message fail, +the kombu transport can be disconnected + +In this case, we must redeclare our consumers. + +This changes fixes that. + +This have no tests because the kombu memory transport we use in our tests +cannot be in disconnected state. + +Closes-bug: #1448650 + +Change-Id: I5991a4cf827411bc27c857561d97461212a17f40 +(cherry picked from commit 415db68b67368d7c8aa550e7108122200816e665) + +Conflicts: + oslo_messaging/_drivers/impl_rabbit.py +--- + oslo_messaging/_drivers/impl_rabbit.py | 7 +++++++ + oslo_messaging/tests/drivers/test_impl_rabbit.py | 16 ++++++++++++++++ + 2 files changed, 23 insertions(+) + +diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py +index a776207..fe279c4 100644 +--- a/oslo_messaging/_drivers/impl_rabbit.py ++++ b/oslo_messaging/_drivers/impl_rabbit.py +@@ -1050,6 +1050,13 @@ class Connection(object): + exc) + + def _consume(): ++ # NOTE(sileht): in case the acknowledgement or requeue of a ++ # message fail, the kombu transport can be disconnected ++ # In this case, we must redeclare our consumers, so raise ++ # a recoverable error to trigger the reconnection code. ++ if not self.connection.connected: ++ raise self.connection.recoverable_connection_errors[0] ++ + if self.do_consume: + queues_head = self.consumers[:-1] # not fanout. + queues_tail = self.consumers[-1] # fanout +diff --git a/oslo_messaging/tests/drivers/test_impl_rabbit.py b/oslo_messaging/tests/drivers/test_impl_rabbit.py +index a7e2a0e..011224b 100644 +--- a/oslo_messaging/tests/drivers/test_impl_rabbit.py ++++ b/oslo_messaging/tests/drivers/test_impl_rabbit.py +@@ -208,6 +208,22 @@ class TestRabbitIterconsume(test_utils.BaseTestCase): + conn.connection.reset() + self.assertEqual(channel, conn.connection.channel) + ++ def test_connection_ack_have_disconnected_kombu_connection(self): ++ transport = oslo_messaging.get_transport(self.conf, ++ 'kombu+memory:////') ++ self.addCleanup(transport.cleanup) ++ with transport._driver._get_connection(amqp.PURPOSE_LISTEN) as conn: ++ conn.connection.connection.recoverable_channel_errors = (IOError,) ++ with mock.patch('kombu.connection.Connection.connected', ++ new_callable=mock.PropertyMock, ++ return_value=False): ++ channel = conn.channel ++ conn.connection.connected = False ++ self.assertRaises(driver_common.Timeout, ++ conn.consume, timeout=0.01) ++ # Ensure a new channel have been setuped ++ self.assertNotEqual(channel, conn.channel) ++ + + class TestRabbitTransportURL(test_utils.BaseTestCase): + +-- +2.1.4 + diff -Nru oslo.messaging-1.8.3/debian/patches/series oslo.messaging-1.8.3/debian/patches/series --- oslo.messaging-1.8.3/debian/patches/series 2015-06-23 07:02:51.000000000 -0700 +++ oslo.messaging-1.8.3/debian/patches/series 2015-06-24 23:17:34.000000000 -0700 @@ -1,4 +1,5 @@ # Patch for vivid - drop once aioeventlet and trollius in main +redeclare-consumers-when-ack-requeue-fails.patch disable-new-executors.patch # ZMQ patches zmq-client-pooling.patch