CLOUDSTACK-2729: increase waiting timeout for global file lock to 300 seconds

(cherry picked from commit 6d86af85ba)
This commit is contained in:
Wei Zhou 2013-08-09 08:58:46 +02:00
parent 706e23623c
commit 64bb700705
1 changed files with 3 additions and 2 deletions

View File

@ -59,6 +59,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
private String _mountPoint = "/mnt";
private String _manageSnapshotPath;
private String _lockfile = "KVMFILELOCK" + File.separator + ".lock";
private static final int ACQUIRE_GLOBAL_FILELOCK_TIMEOUT_FOR_KVM = 300; // 300 seconds
public LibvirtStorageAdaptor(StorageLayer storage) {
_storageLayer = storage;
@ -885,7 +886,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
}
String lockFile = spd.getTargetPath() + File.separator + _lockfile;
s_logger.debug("Attempting to lock pool " + pool.getName() + " with file " + lockFile);
if (lock(lockFile, 30)) {
if (lock(lockFile, ACQUIRE_GLOBAL_FILELOCK_TIMEOUT_FOR_KVM)) {
try {
pool.refresh(0);
} finally {
@ -905,7 +906,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
}
String lockFile = pool.getLocalPath() + File.separator + _lockfile;
s_logger.debug("Attempting to lock pool " + pool.getName() + " with file " + lockFile);
if (lock(lockFile, 30)) {
if (lock(lockFile, ACQUIRE_GLOBAL_FILELOCK_TIMEOUT_FOR_KVM)) {
try {
vol.delete(0);
} finally {