|
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<>("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<>("Advanced", Integer.class, "direct.agent.load.size", "16", |
@@ -1945,7 +1947,7 @@ protected class AgentNewConnectionsMonitorTask extends ManagedContextRunnable { |
1945 | 1947 | @Override |
1946 | 1948 | protected void runInContext() { |
1947 | 1949 | logger.trace("Agent New Connections Monitor is started."); |
1948 | | - final int cleanupTime = Wait.value(); |
| 1950 | + final int cleanupTime = RemoteAgentNewConnectionsMonitorInterval.value(); |
1949 | 1951 | Set<Map.Entry<String, Long>> entrySet = newAgentConnections.entrySet(); |
1950 | 1952 | long cutOff = System.currentTimeMillis() - (cleanupTime * 1000L); |
1951 | 1953 | List<String> expiredConnections = newAgentConnections.entrySet() |
@@ -2040,7 +2042,8 @@ public String getConfigComponentName() { |
2040 | 2042 | public ConfigKey<?>[] getConfigKeys() { |
2041 | 2043 | return new ConfigKey<?>[] { CheckTxnBeforeSending, Workers, Port, Wait, AlertWait, DirectAgentLoadSize, |
2042 | 2044 | DirectAgentPoolSize, DirectAgentThreadCap, EnableKVMAutoEnableDisable, ReadyCommandWait, |
2043 | | - GranularWaitTimeForCommands, RemoteAgentSslHandshakeTimeout, RemoteAgentMaxConcurrentNewConnections }; |
| 2045 | + GranularWaitTimeForCommands, RemoteAgentSslHandshakeTimeout, RemoteAgentMaxConcurrentNewConnections, |
| 2046 | + RemoteAgentNewConnectionsMonitorInterval }; |
2044 | 2047 | } |
2045 | 2048 |
|
2046 | 2049 | protected class SetHostParamsListener implements Listener { |
|
0 commit comments