From a3a5f23487e9ca4257551fd3d430d8ebcfca131a Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Wed, 16 May 2012 06:37:28 +0000 Subject: Remove XenAPI use of eventlet tpool XenAPI implementation does not block, even with it using SSL, therefore there's no need to use eventlet's tpool. Change-Id: I33ef4140068c8af06d27a075f52379581790c647 --- nova/virt/xenapi/connection.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'nova') diff --git a/nova/virt/xenapi/connection.py b/nova/virt/xenapi/connection.py index 5d28e25e3..35634ac11 100644 --- a/nova/virt/xenapi/connection.py +++ b/nova/virt/xenapi/connection.py @@ -18,12 +18,6 @@ """ A connection to XenServer or Xen Cloud Platform. -The concurrency model for this class is as follows: - -All XenAPI calls are on a green thread (using eventlet's "tpool" -thread pool). They are remote calls, and so may hang for the usual -reasons. - **Related Flags** :xenapi_connection_url: URL for connection to XenServer/Xen Cloud Platform. @@ -48,10 +42,8 @@ import time import urlparse import xmlrpclib -from eventlet import greenthread from eventlet import queue from eventlet import timeout -from eventlet import tpool from nova import context from nova import db @@ -589,8 +581,7 @@ class XenAPISession(object): def call_xenapi(self, method, *args): """Call the specified XenAPI method on a background thread.""" with self._get_session() as session: - f = session.xenapi_request - return tpool.execute(f, method, args) + return session.xenapi_request(method, args) def call_plugin(self, plugin, fn, args): """Call host.call_plugin on a background thread.""" @@ -605,7 +596,7 @@ class XenAPISession(object): args['host_uuid'] = self.host_uuid with self._get_session() as session: - return tpool.execute(self._unwrap_plugin_exceptions, + return self._unwrap_plugin_exceptions( session.xenapi.host.call_plugin, host, plugin, fn, args) @@ -624,6 +615,7 @@ class XenAPISession(object): exc.details[2] == 'Failure'): params = None try: + # FIXME(comstud): eval is evil. params = eval(exc.details[3]) except Exception: raise exc -- cgit