Merge lp:~joshua-mckenty/nova/rabbit-no-leak into lp:~hudson-openstack/nova/trunk

Proposed by Joshua McKenty
Status: Merged
Approved by: Monty Taylor
Approved revision: 141
Merged at revision: 148
Proposed branch: lp:~joshua-mckenty/nova/rabbit-no-leak
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 33 lines (+7/-2)
1 file modified
nova/rpc.py (+7/-2)
To merge this branch: bzr merge lp:~joshua-mckenty/nova/rabbit-no-leak
Reviewer Review Type Date Requested Status
Monty Taylor (community) Approve
Soren Hansen (community) Approve
Review via email: mp+30155@code.launchpad.net

Commit message

Send message ack in rpc.call and make queues durable.

Description of the change

We weren't acking messages in rpc.call receives.
Also made queues non-durable.

To post a comment you must log in.
Revision history for this message
Soren Hansen (soren) wrote :

lgtm

review: Approve
Revision history for this message
Monty Taylor (mordred) wrote :

me too

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/rpc.py'
2--- nova/rpc.py 2010-07-15 23:13:48 +0000
3+++ nova/rpc.py 2010-07-16 21:23:38 +0000
4@@ -110,6 +110,7 @@
5 self.queue = topic
6 self.routing_key = topic
7 self.exchange = FLAGS.control_exchange
8+ self.durable = False
9 super(TopicConsumer, self).__init__(connection=connection)
10
11
12@@ -195,7 +196,10 @@
13 conn = Connection.instance()
14 d = defer.Deferred()
15 consumer = DirectConsumer(connection=conn, msg_id=msg_id)
16- consumer.register_callback(lambda data, message: d.callback(data))
17+ def deferred_receive(data, message):
18+ message.ack()
19+ d.callback(data)
20+ consumer.register_callback(deferred_receive)
21 injected = consumer.attach_to_tornado()
22
23 # clean up after the injected listened and return x
24@@ -233,7 +237,8 @@
25 exchange=msg_id,
26 auto_delete=True,
27 exchange_type="direct",
28- routing_key=msg_id)
29+ routing_key=msg_id,
30+ durable=False)
31 consumer.register_callback(generic_response)
32
33 publisher = messaging.Publisher(connection=Connection.instance(),