summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2011-06-29 09:49:19 -0700
committerChris Behrens <cbehrens@codestud.com>2011-06-29 09:49:19 -0700
commit45e5ae28377abc0eefd2e71ef553380b25283c48 (patch)
tree9f2083609412463aa3f9c7cc51b607d9eeb0426c
parent463766fbffff00e333ded0123bc1bc45513db061 (diff)
downloadnova-45e5ae28377abc0eefd2e71ef553380b25283c48.tar.gz
nova-45e5ae28377abc0eefd2e71ef553380b25283c48.tar.xz
nova-45e5ae28377abc0eefd2e71ef553380b25283c48.zip
Fanout queues use unique queue names, so the consumer should have exclusive access. This means that they also get auto deleted when we're done with them, so they're not left around on a service restart. Fixes lp:803165
-rw-r--r--nova/rpc.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/rpc.py b/nova/rpc.py
index 2e78a31e7..9f0b507fd 100644
--- a/nova/rpc.py
+++ b/nova/rpc.py
@@ -275,6 +275,11 @@ class FanoutAdapterConsumer(AdapterConsumer):
unique = uuid.uuid4().hex
self.queue = '%s_fanout_%s' % (topic, unique)
self.durable = False
+ # Fanout creates unique queue names, so we should auto-remove
+ # them when done, so they're not left around on restart.
+ # Also, we're the only one that should be consuming. exclusive
+ # implies auto_delete, so we'll just set that..
+ self.exclusive = True
LOG.info(_('Created "%(exchange)s" fanout exchange '
'with "%(key)s" routing key'),
dict(exchange=self.exchange, key=self.routing_key))