Merge lp:~soren/nova/rpc-threadpool into lp:~hudson-openstack/nova/trunk

Proposed by Soren Hansen on 2011-02-15
Status: Merged
Approved by: Soren Hansen on 2011-02-16
Approved revision: 675
Merged at revision: 683
Proposed branch: lp:~soren/nova/rpc-threadpool
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 37 lines (+8/-1)
1 file modified
nova/ (+8/-1)
To merge this branch: bzr merge lp:~soren/nova/rpc-threadpool
Reviewer Review Type Date Requested Status
Devin Carlen (community) Approve on 2011-02-16
Jay Pipes (community) 2011-02-15 Approve on 2011-02-16
Review via email:

Commit message

Use a threadpool for handling requests coming in through RPC.

Description of the change

Is this really this simple?

To post a comment you must log in.
Soren Hansen (soren) wrote :

I mean.... it does what it says on the tin, but I wonder if there are any
side effects I haven't thought of..

Jay Pipes (jaypipes) wrote :

hmm, lgtm. maybe it really is this easy...

review: Approve
Devin Carlen (devcamcar) wrote :

suspiciously simple! :)

review: Approve
OpenStack Infra (hudson-openstack) wrote :
Download full text (36.3 KiB)

The attempt to merge lp:~soren/nova/rpc-threadpool into lp:nova failed. Below is the output from the failed tests.

    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    test_basic ok
    test_defaults_to_json ok
    test_deserialize ok
    test_deserialize_empty_xml ok
    test_suffix_takes_precedence_over_accept_header ok
    test_controller ok
    test_debug ok
    test_router ok
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    test_multiple_positional_format_placeholders ok
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR

ERROR: Failure: AttributeError (DEFINE_integer)
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/nose/", line 379, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/pymodules/python2.6/nose/", line 39, in importFromPath
    return self.importFromDir(...

lp:~soren/nova/rpc-threadpool updated on 2011-02-16
674. By Soren Hansen on 2011-02-16

Spell flags correctly (i.e. not in upper case)

675. By Soren Hansen on 2011-02-16

Merge trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/'
2--- nova/ 2011-02-11 11:27:50 +0000
3+++ nova/ 2011-02-16 19:40:49 +0000
4@@ -29,6 +29,7 @@
6 from carrot import connection as carrot_connection
7 from carrot import messaging
8+from eventlet import greenpool
9 from eventlet import greenthread
11 from nova import context
12@@ -42,6 +43,8 @@
13 FLAGS = flags.FLAGS
14 LOG = logging.getLogger('nova.rpc')
16+flags.DEFINE_integer('rpc_thread_pool_size', 1024, 'Size of RPC thread pool')
19 class Connection(carrot_connection.BrokerConnection):
20 """Connection instance object"""
21@@ -155,11 +158,15 @@
22 def __init__(self, connection=None, topic="broadcast", proxy=None):
23 LOG.debug(_('Initing the Adapter Consumer for %s') % topic)
24 self.proxy = proxy
25+ self.pool = greenpool.GreenPool(FLAGS.rpc_thread_pool_size)
26 super(AdapterConsumer, self).__init__(connection=connection,
27 topic=topic)
29+ def receive(self, *args, **kwargs):
30+ self.pool.spawn_n(self._receive, *args, **kwargs)
32 @exception.wrap_exception
33- def receive(self, message_data, message):
34+ def _receive(self, message_data, message):
35 """Magically looks for a method on the proxy object and calls it
37 Message data should be a dictionary with two keys: