summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Still <mikal@stillhq.com>2012-11-08 12:12:30 +1100
committerMichael Still <mikal@stillhq.com>2012-11-08 12:12:30 +1100
commitf2d5869d8c83cf420fc29cecbefc42d2d2f65839 (patch)
tree616e943fac5c1af35f156c7332613242b946aa46
parent7f1f2ef86855d436bf7ff9ce7194eb90b857d518 (diff)
downloadnova-f2d5869d8c83cf420fc29cecbefc42d2d2f65839.tar.gz
nova-f2d5869d8c83cf420fc29cecbefc42d2d2f65839.tar.xz
nova-f2d5869d8c83cf420fc29cecbefc42d2d2f65839.zip
Yield in between hash runs for the image cache manager.
This should stop the cache manager from locking up nova-compute for long periods of time. Change-Id: Icc510a55282b479b3ba673ac68aee793da1714fb
-rw-r--r--nova/virt/libvirt/imagecache.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/virt/libvirt/imagecache.py b/nova/virt/libvirt/imagecache.py
index 721587512..efc57eea5 100644
--- a/nova/virt/libvirt/imagecache.py
+++ b/nova/virt/libvirt/imagecache.py
@@ -313,6 +313,9 @@ class ImageCacheManager(object):
if not checksum_result is None:
image_bad = not checksum_result
+ # Give other threads a chance to run
+ time.sleep(0)
+
instances = []
if img_id in self.used_images:
local, remote, instances = self.used_images[img_id]