New patch submitted by Saggi Mizrahi (smizrahi(a)redhat.com)
You can review this change at:
http://gerrit.usersys.redhat.com/859
commit b89e3c611a2d8e696f8c0477769828e93dd91664
Author: Saggi Mizrahi <smizrahi(a)redhat.com>
Date: Sun Aug 28 11:52:05 2011 +0300
BZ#730778 - Add timeout when acquiring resources in prepareVolume
Change-Id: I1bbe6ea0ff82a4af3c728f520546870324363c44
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index f83316c..f063f87 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1697,8 +1697,9 @@ class HSM:
vars.task.getSharedLock(STORAGE, sdUUID)
imageResourcesNamespace = sd.getNamespace(sdUUID, IMAGE_NAMESPACE)
lockType = rm.LockType.exclusive if rw else rm.LockType.shared
+ timeout = config.getint('irs', 'task_resource_default_timeout')
- imgResource = rmanager.acquireResource(imageResourcesNamespace, imgUUID,
lockType)
+ imgResource = rmanager.acquireResource(imageResourcesNamespace, imgUUID,
lockType, timeout)
try:
vol = SDF.produce(sdUUID=sdUUID).produceVolume(imgUUID=imgUUID,
volUUID=volUUID)
# NB We want to be sure that at this point HSM does not use stale LVM