summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-09-18 23:29:41 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-09-19 18:46:49 +0000
commit7df1908aae47461a648df94e7ae4bba912adee5e (patch)
treec8977ca5d44af4f9ab61090306e2442c7d29ff4a /nova/compute
parent8473bb4cf93eb713ef42fdc87767aa938f36b43e (diff)
Always yield to other greenthreads after database calls
Since common database backends (eg MySQLdb and sqlite) are implemented in C extensions, eventlet cannot monkey patch the socket calls to ensure greenthread context switches occur during network I/O. Previously, this was done by sprinkling explicit greenthread.sleep(0) calls in areas known to cause problems. Switch that to always do a yield after execute. Change-Id: If91e49fbe212a02710b6ba4abd456222552e2575
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/manager.py7
1 files changed, 0 insertions, 7 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 2f977b26c..e4db4a3c2 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -2435,9 +2435,6 @@ class ComputeManager(manager.SchedulerDependentManager):
{'status': 'error'})
for migration in migrations:
- # NOTE(comstud): Yield to other greenthreads. Putting this
- # at the top so we make sure to do it on each iteration.
- greenthread.sleep(0)
migration_id = migration['id']
instance_uuid = migration['instance_uuid']
LOG.info(_("Automatically confirming migration "
@@ -2539,8 +2536,6 @@ class ComputeManager(manager.SchedulerDependentManager):
refreshed = timeutils.utcnow()
for usage in bw_usage:
- # Allow switching of greenthreads between queries.
- greenthread.sleep(0)
self.db.bw_usage_update(context,
usage['uuid'],
usage['mac_address'],
@@ -2584,8 +2579,6 @@ class ComputeManager(manager.SchedulerDependentManager):
"%(num_vm_instances)s on the hypervisor.") % locals())
for db_instance in db_instances:
- # Allow other periodic tasks to do some work...
- greenthread.sleep(0)
db_power_state = db_instance['power_state']
if db_instance['task_state'] is not None:
LOG.info(_("During sync_power_state the instance has a "