Delete fanout queues on gracefully shutdown
No reasons to kept fanout queues in case then a rpc server is gracefully shutdown. The expiration time of the fanout queue is too long (30 mins), so for large scales it can accumulate a lot of messages before it be removed Closes-Bug: 1606213 Change-Id: Ieaa35c454df542042f3a5424d70f87d486693024
This commit is contained in:
parent
0ecc25509f
commit
a6f0aaed3f
@ -844,6 +844,11 @@ class Connection(object):
|
|||||||
"""Close/release this connection."""
|
"""Close/release this connection."""
|
||||||
self._heartbeat_stop()
|
self._heartbeat_stop()
|
||||||
if self.connection:
|
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._set_current_channel(None)
|
||||||
self.connection.release()
|
self.connection.release()
|
||||||
self.connection = None
|
self.connection = None
|
||||||
@ -852,7 +857,6 @@ class Connection(object):
|
|||||||
"""Reset a connection so it can be used again."""
|
"""Reset a connection so it can be used again."""
|
||||||
recoverable_errors = (self.connection.recoverable_channel_errors +
|
recoverable_errors = (self.connection.recoverable_channel_errors +
|
||||||
self.connection.recoverable_connection_errors)
|
self.connection.recoverable_connection_errors)
|
||||||
|
|
||||||
with self._connection_lock:
|
with self._connection_lock:
|
||||||
try:
|
try:
|
||||||
for consumer, tag in self._consumers.items():
|
for consumer, tag in self._consumers.items():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user