Skip to content

Commit 6d86af8

Browse files
committed
CLOUDSTACK-2729: increase waiting timeout for global file lock to 300 seconds
1 parent 75cd6cc commit 6d86af8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
7373
private String _mountPoint = "/mnt";
7474
private String _manageSnapshotPath;
7575
private String _lockfile = "KVMFILELOCK" + File.separator + ".lock";
76+
private static final int ACQUIRE_GLOBAL_FILELOCK_TIMEOUT_FOR_KVM = 300; // 300 seconds
7677

7778
private String rbdTemplateSnapName = "cloudstack-base-snap";
7879
private int rbdFeatures = (1<<0); /* Feature 1<<0 means layering in RBD format 2 */
@@ -1175,7 +1176,7 @@ private void refreshPool(StoragePool pool) throws LibvirtException {
11751176
}
11761177
String lockFile = spd.getTargetPath() + File.separator + _lockfile;
11771178
s_logger.debug("Attempting to lock pool " + pool.getName() + " with file " + lockFile);
1178-
if (lock(lockFile, 30)) {
1179+
if (lock(lockFile, ACQUIRE_GLOBAL_FILELOCK_TIMEOUT_FOR_KVM)) {
11791180
try {
11801181
pool.refresh(0);
11811182
} finally {
@@ -1195,7 +1196,7 @@ private void deleteVol(LibvirtStoragePool pool, StorageVol vol) throws LibvirtEx
11951196
}
11961197
String lockFile = pool.getLocalPath() + File.separator + _lockfile;
11971198
s_logger.debug("Attempting to lock pool " + pool.getName() + " with file " + lockFile);
1198-
if (lock(lockFile, 30)) {
1199+
if (lock(lockFile, ACQUIRE_GLOBAL_FILELOCK_TIMEOUT_FOR_KVM)) {
11991200
try {
12001201
vol.delete(0);
12011202
} finally {

0 commit comments

Comments
 (0)