|
55 | 55 | import org.apache.cloudstack.management.ManagementServerHost; |
56 | 56 | import org.apache.cloudstack.outofbandmanagement.dao.OutOfBandManagementDao; |
57 | 57 | import org.apache.cloudstack.utils.identity.ManagementServerNode; |
58 | | -import org.apache.commons.collections.MapUtils; |
59 | 58 | import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils; |
| 59 | +import org.apache.commons.collections.MapUtils; |
60 | 60 | import org.apache.commons.lang3.BooleanUtils; |
61 | 61 | import org.apache.commons.lang3.StringUtils; |
62 | 62 | import org.apache.logging.log4j.ThreadContext; |
@@ -223,6 +223,8 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl |
223 | 223 | "Number of maximum concurrent new connections server allows for remote (indirect) agents. " + |
224 | 224 | "If set to zero (default value) then no limit will be enforced on concurrent new connections", |
225 | 225 | false); |
| 226 | + protected final ConfigKey<Integer> RemoteAgentNewConnectionsMonitorInterval = new ConfigKey<>("Advanced", Integer.class, "agent.connections.monitor.interval", "1800", |
| 227 | + "Time in seconds to monitor the new agent connections and cleanup the expired connections.", false); |
226 | 228 | protected final ConfigKey<Integer> AlertWait = new ConfigKey<Integer>("Advanced", Integer.class, "alert.wait", "1800", |
227 | 229 | "Seconds to wait before alerting on a disconnected agent", true); |
228 | 230 | protected final ConfigKey<Integer> DirectAgentLoadSize = new ConfigKey<Integer>("Advanced", Integer.class, "direct.agent.load.size", "16", |
@@ -1960,7 +1962,7 @@ protected class AgentNewConnectionsMonitorTask extends ManagedContextRunnable { |
1960 | 1962 | @Override |
1961 | 1963 | protected void runInContext() { |
1962 | 1964 | logger.trace("Agent New Connections Monitor is started."); |
1963 | | - final int cleanupTime = Wait.value(); |
| 1965 | + final int cleanupTime = RemoteAgentNewConnectionsMonitorInterval.value(); |
1964 | 1966 | Set<Map.Entry<String, Long>> entrySet = newAgentConnections.entrySet(); |
1965 | 1967 | long cutOff = System.currentTimeMillis() - (cleanupTime * 1000L); |
1966 | 1968 | List<String> expiredConnections = newAgentConnections.entrySet() |
@@ -2055,7 +2057,8 @@ public String getConfigComponentName() { |
2055 | 2057 | public ConfigKey<?>[] getConfigKeys() { |
2056 | 2058 | return new ConfigKey<?>[] { CheckTxnBeforeSending, Workers, Port, Wait, AlertWait, DirectAgentLoadSize, |
2057 | 2059 | DirectAgentPoolSize, DirectAgentThreadCap, EnableKVMAutoEnableDisable, ReadyCommandWait, |
2058 | | - GranularWaitTimeForCommands, RemoteAgentSslHandshakeTimeout, RemoteAgentMaxConcurrentNewConnections }; |
| 2060 | + GranularWaitTimeForCommands, RemoteAgentSslHandshakeTimeout, RemoteAgentMaxConcurrentNewConnections, |
| 2061 | + RemoteAgentNewConnectionsMonitorInterval }; |
2059 | 2062 | } |
2060 | 2063 |
|
2061 | 2064 | protected class SetHostParamsListener implements Listener { |
|
0 commit comments