mirror of https://github.com/apache/cloudstack.git
kvm: fix/optimize propogating configs (#3911)
Make some changes based on @nvazquez 's comments in PR #3491 Fix a bug in #3491
This commit is contained in:
parent
313e21a0da
commit
b4fdf22397
|
|
@ -319,9 +319,12 @@ public class VirtualRoutingResource {
|
|||
}
|
||||
|
||||
public boolean configureHostParams(final Map<String, String> params) {
|
||||
if (_params.get("router.aggregation.command.each.timeout") == null) {
|
||||
if (_params.get("router.aggregation.command.each.timeout") != null) {
|
||||
String value = (String)params.get("router.aggregation.command.each.timeout");
|
||||
_eachTimeout = Duration.standardSeconds(NumbersUtil.parseInt(value, 10));
|
||||
_eachTimeout = Duration.standardSeconds(NumbersUtil.parseLong(value, 600));
|
||||
if (s_logger.isDebugEnabled()){
|
||||
s_logger.debug("The router.aggregation.command.each.timeout in seconds is set to " + _eachTimeout.getStandardSeconds());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
// under the License.
|
||||
package com.cloud.agent;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.framework.config.ConfigKey;
|
||||
|
||||
import com.cloud.agent.api.Answer;
|
||||
|
|
@ -153,5 +155,5 @@ public interface AgentManager {
|
|||
|
||||
void notifyMonitorsOfRemovedHost(long hostId, long clusterId);
|
||||
|
||||
void propagateChangeToAgents();
|
||||
void propagateChangeToAgents(Map<String, String> params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1822,11 +1822,11 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
|||
}
|
||||
|
||||
@Override
|
||||
public void propagateChangeToAgents() {
|
||||
s_logger.debug("Propagating changes on host parameters to the agents");
|
||||
Map<Long, List<Long>> hostsPerZone = getHostsPerZone();
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("router.aggregation.command.each.timeout", _configDao.getValue("router.aggregation.command.each.timeout"));
|
||||
sendCommandToAgents(hostsPerZone, params);
|
||||
public void propagateChangeToAgents(Map<String, String> params) {
|
||||
if (params != null && ! params.isEmpty()) {
|
||||
s_logger.debug("Propagating changes on host parameters to the agents");
|
||||
Map<Long, List<Long>> hostsPerZone = getHostsPerZone();
|
||||
sendCommandToAgents(hostsPerZone, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1106,8 +1106,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
|||
storage.configure("Storage", new HashMap<String, Object>());
|
||||
if (params.get("router.aggregation.command.each.timeout") != null) {
|
||||
String value = (String)params.get("router.aggregation.command.each.timeout");
|
||||
Integer intValue = NumbersUtil.parseInt(value, 600);
|
||||
storage.persist("router.aggregation.command.each.timeout", String.valueOf(intValue));
|
||||
Long longValue = NumbersUtil.parseLong(value, 600);
|
||||
storage.persist("router.aggregation.command.each.timeout", String.valueOf(longValue));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -483,7 +483,9 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
|||
globalSettingUpdated.equals(IndirectAgentLBServiceImpl.IndirectAgentLBAlgorithm.key())) {
|
||||
_indirectAgentLB.propagateMSListToAgents();
|
||||
} else if (globalSettingUpdated.equals(Config.RouterAggregationCommandEachTimeout.toString())) {
|
||||
_agentManager.propagateChangeToAgents();
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put(Config.RouterAggregationCommandEachTimeout.toString(), _configDao.getValue(Config.RouterAggregationCommandEachTimeout.toString()));
|
||||
_agentManager.propagateChangeToAgents(params);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue