Merge remote-tracking branch 'origin/4.13'

This commit is contained in:
Rohit Yadav 2020-03-05 12:37:51 +05:30
commit d0e3c577c0
5 changed files with 19 additions and 12 deletions

View File

@ -397,9 +397,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;

View File

@ -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);
}

View File

@ -1824,11 +1824,11 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
}
@Override
public void propagateChangeToAgents() {
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();
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);
}
}
}

View File

@ -1116,8 +1116,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;

View File

@ -486,7 +486,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);
}
}
});