HA worker thread needs to have its own worker thread configuration

This commit is contained in:
Edison Su 2012-08-17 12:54:02 -07:00
parent fb720ee41b
commit d6092380cd
2 changed files with 3 additions and 1 deletions

View File

@ -173,6 +173,7 @@ public enum Config {
XapiWait("Advanced", AgentManager.class, Integer.class, "xapiwait", "600", "Time (in seconds) to wait for XAPI to return", null),
MigrateWait("Advanced", AgentManager.class, Integer.class, "migratewait", "3600", "Time (in seconds) to wait for VM migrate finish", null),
Workers("Advanced", AgentManager.class, Integer.class, "workers", "5", "Number of worker threads.", null),
HAWorkers("Advanced", AgentManager.class, Integer.class, "ha.workers", "5", "Number of ha worker threads.", null),
MountParent("Advanced", ManagementServer.class, String.class, "mount.parent", "/var/lib/cloud/management/mnt", "The mount point on the Management Server for Secondary Storage.", null),
// UpgradeURL("Advanced", ManagementServer.class, String.class, "upgrade.url", "http://example.com:8080/client/agent/update.zip", "The upgrade URL is the URL of the management server that agents will connect to in order to automatically upgrade.", null),
SystemVMUseLocalStorage("Advanced", ManagementServer.class, Boolean.class, "system.vm.use.local.storage", "false", "Indicates whether to use local storage pools or shared storage pools for system VMs.", null),

View File

@ -33,6 +33,7 @@ import com.cloud.alert.AlertManager;
import com.cloud.cluster.ClusterManagerListener;
import com.cloud.cluster.ManagementServerHostVO;
import com.cloud.cluster.StackMaid;
import com.cloud.configuration.Config;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.dc.ClusterDetailsDao;
import com.cloud.dc.DataCenterVO;
@ -699,7 +700,7 @@ public class HighAvailabilityManagerImpl implements HighAvailabilityManager, Clu
params = configDao.getConfiguration(Long.toHexString(_serverId), xmlParams);
}
String value = params.get("workers");
String value = params.get(Config.HAWorkers.key());
final int count = NumbersUtil.parseInt(value, 1);
_workers = new WorkerThread[count];
for (int i = 0; i < _workers.length; i++) {