diff -Nru oslo.messaging-1.3.0/debian/changelog oslo.messaging-1.3.0/debian/changelog --- oslo.messaging-1.3.0/debian/changelog 2015-06-25 17:01:10.000000000 +0800 +++ oslo.messaging-1.3.0/debian/changelog 2015-12-17 16:24:09.000000000 +0800 @@ -1,3 +1,11 @@ +oslo.messaging (1.3.0-0ubuntu1.3) trusty; urgency=medium + + * Backport upstream release. (LP: #1318721): + - d/p/fix-reconnect-race-condition-with-rabbitmq-cluster.patch: + Redeclare if exception is catched after self.queue.declare() failed. + + -- Hui Xiang Thu, 17 Dec 2015 16:22:35 +0800 + oslo.messaging (1.3.0-0ubuntu1.2) trusty; urgency=medium * Detect when underlying kombu connection to rabbitmq server has been diff -Nru oslo.messaging-1.3.0/debian/patches/fix-reconnect-race-condition-with-rabbitmq-cluster.patch oslo.messaging-1.3.0/debian/patches/fix-reconnect-race-condition-with-rabbitmq-cluster.patch --- oslo.messaging-1.3.0/debian/patches/fix-reconnect-race-condition-with-rabbitmq-cluster.patch 1970-01-01 08:00:00.000000000 +0800 +++ oslo.messaging-1.3.0/debian/patches/fix-reconnect-race-condition-with-rabbitmq-cluster.patch 2015-12-17 16:21:42.000000000 +0800 @@ -0,0 +1,24 @@ +--- a/oslo/messaging/_drivers/impl_rabbit.py ++++ b/oslo/messaging/_drivers/impl_rabbit.py +@@ -159,7 +159,20 @@ + self.channel = channel + self.kwargs['channel'] = channel + self.queue = kombu.entity.Queue(**self.kwargs) +- self.queue.declare() ++ try: ++ self.queue.declare() ++ except Exception as e: ++ # NOTE: This exception may be triggered by a race condition. ++ # Simply retrying will solve the error most of the time and ++ # should work well enough as a workaround until the race condition ++ # itself can be fixed. ++ # TODO(jrosenboom): In order to be able to match the Execption ++ # more specifically, we have to refactor ConsumerBase to use ++ # 'channel_errors' of the kombu connection object that ++ # has created the channel. ++ # See https://bugs.launchpad.net/neutron/+bug/1318721 for details. ++ LOG.exception(_("Declaring queue failed with (%s), retrying"), e) ++ self.queue.declare() + + def _callback_handler(self, message, callback): + """Call callback with deserialized message. diff -Nru oslo.messaging-1.3.0/debian/patches/series oslo.messaging-1.3.0/debian/patches/series --- oslo.messaging-1.3.0/debian/patches/series 2015-06-25 16:59:40.000000000 +0800 +++ oslo.messaging-1.3.0/debian/patches/series 2015-12-17 16:22:00.000000000 +0800 @@ -3,3 +3,4 @@ 0002-rabbit-fix-timeout-timer-when-duration-is-None.patch 0003-Declare-DirectPublisher-exchanges-with-passive-True.patch redeclare-consumers-when-ack-requeue-fails.patch +fix-reconnect-race-condition-with-rabbitmq-cluster.patch