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

Proposed by Soren Hansen
Status: Merged
Approved by: Soren Hansen
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/rpc.py (+8/-1)
To merge this branch: bzr merge lp:~soren/nova/rpc-threadpool
Reviewer Review Type Date Requested Status
Devin Carlen (community) Approve
Jay Pipes (community) Approve
Review via email: mp+49896@code.launchpad.net

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.
Revision history for this message
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..

Revision history for this message
Jay Pipes (jaypipes) wrote :

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

review: Approve
Revision history for this message
Devin Carlen (devcamcar) wrote :

suspiciously simple! :)

review: Approve
Revision history for this message
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.

Failure
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
SerializerTest
    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
    test_controller ok
    test_debug ok
    test_router ok
Failure
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
    runTest ERROR
LocalizationTestCase
    test_multiple_positional_format_placeholders ok
Failure
    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/loader.py", line 379, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/pymodules/python2.6/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(...

lp:~soren/nova/rpc-threadpool updated
674. By Soren Hansen

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

675. By Soren Hansen

Merge trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'nova/rpc.py'
--- nova/rpc.py 2011-02-11 11:27:50 +0000
+++ nova/rpc.py 2011-02-16 19:40:49 +0000
@@ -29,6 +29,7 @@
2929
30from carrot import connection as carrot_connection30from carrot import connection as carrot_connection
31from carrot import messaging31from carrot import messaging
32from eventlet import greenpool
32from eventlet import greenthread33from eventlet import greenthread
3334
34from nova import context35from nova import context
@@ -42,6 +43,8 @@
42FLAGS = flags.FLAGS43FLAGS = flags.FLAGS
43LOG = logging.getLogger('nova.rpc')44LOG = logging.getLogger('nova.rpc')
4445
46flags.DEFINE_integer('rpc_thread_pool_size', 1024, 'Size of RPC thread pool')
47
4548
46class Connection(carrot_connection.BrokerConnection):49class Connection(carrot_connection.BrokerConnection):
47 """Connection instance object"""50 """Connection instance object"""
@@ -155,11 +158,15 @@
155 def __init__(self, connection=None, topic="broadcast", proxy=None):158 def __init__(self, connection=None, topic="broadcast", proxy=None):
156 LOG.debug(_('Initing the Adapter Consumer for %s') % topic)159 LOG.debug(_('Initing the Adapter Consumer for %s') % topic)
157 self.proxy = proxy160 self.proxy = proxy
161 self.pool = greenpool.GreenPool(FLAGS.rpc_thread_pool_size)
158 super(AdapterConsumer, self).__init__(connection=connection,162 super(AdapterConsumer, self).__init__(connection=connection,
159 topic=topic)163 topic=topic)
160164
165 def receive(self, *args, **kwargs):
166 self.pool.spawn_n(self._receive, *args, **kwargs)
167
161 @exception.wrap_exception168 @exception.wrap_exception
162 def receive(self, message_data, message):169 def _receive(self, message_data, message):
163 """Magically looks for a method on the proxy object and calls it170 """Magically looks for a method on the proxy object and calls it
164171
165 Message data should be a dictionary with two keys:172 Message data should be a dictionary with two keys: