Merge "Delete fanout queues on gracefully shutdown"

This commit is contained in:
Jenkins 2016-07-26 23:44:48 +00:00 committed by Gerrit Code Review
commit 2f810679f1
1 changed files with 5 additions and 1 deletions

View File

@ -844,6 +844,11 @@ class Connection(object):
"""Close/release this connection."""
self._heartbeat_stop()
if self.connection:
for consumer, tag in self._consumers.items():
if consumer.type == 'fanout':
LOG.debug('[connection close] Deleting fanout '
'queue: %s ' % consumer.queue.name)
consumer.queue.delete()
self._set_current_channel(None)
self.connection.release()
self.connection = None
@ -852,7 +857,6 @@ class Connection(object):
"""Reset a connection so it can be used again."""
recoverable_errors = (self.connection.recoverable_channel_errors +
self.connection.recoverable_connection_errors)
with self._connection_lock:
try:
for consumer, tag in self._consumers.items():