mirror of https://github.com/apache/cloudstack.git
bug 9487: race condition in taking ownership
This commit is contained in:
parent
48eebe8e7a
commit
b979b782c1
|
|
@ -121,7 +121,7 @@ public class SnapshotSchedulerImpl implements SnapshotScheduler {
|
|||
scanLock.releaseRef();
|
||||
}
|
||||
|
||||
scanLock = GlobalLock.getInternLock(this.getClass().getName());
|
||||
scanLock = GlobalLock.getInternLock("snapshot.poll");
|
||||
try {
|
||||
if(scanLock.lock(ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_COOPERATION)) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.cloud.vm;
|
|||
import com.cloud.vm.SystemVmLoadScanner.AfterScanAction;
|
||||
|
||||
public interface SystemVmLoadScanHandler<T> {
|
||||
String getScanHandlerName();
|
||||
boolean canScan();
|
||||
|
||||
void onScanStart();
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class SystemVmLoadScanner<T> {
|
|||
public SystemVmLoadScanner(SystemVmLoadScanHandler<T> scanHandler) {
|
||||
_scanHandler = scanHandler;
|
||||
_capacityScanScheduler = Executors.newScheduledThreadPool(1, new NamedThreadFactory(scanHandler.getClass().getSimpleName()));
|
||||
_capacityScanLock = GlobalLock.getInternLock(scanHandler.getClass().getSimpleName() + ".scan.lock");
|
||||
_capacityScanLock = GlobalLock.getInternLock(scanHandler.getScanHandlerName() + ".scan.lock");
|
||||
}
|
||||
|
||||
public void initScan(long startupDelayMs, long scanIntervalMs) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue