mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-31 01:24:19 +02:00
cluster: Fix idle timeout.
This commit is contained in:
parent
2e6f7d3cdb
commit
7fcde9eca8
@ -435,6 +435,9 @@ void ClusterComponent::NewClientHandler(const Socket::Ptr& client, TlsRole role)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(this);
|
ObjectLock olock(this);
|
||||||
|
Stream::Ptr oldClient = endpoint->GetClient();
|
||||||
|
if (oldClient)
|
||||||
|
oldClient->Close();
|
||||||
endpoint->SetClient(tlsStream);
|
endpoint->SetClient(tlsStream);
|
||||||
ReplayLog(endpoint, tlsStream);
|
ReplayLog(endpoint, tlsStream);
|
||||||
}
|
}
|
||||||
@ -455,14 +458,16 @@ void ClusterComponent::ClusterTimerHandler(void)
|
|||||||
|
|
||||||
/* check if we've recently seen heartbeat messages from our peers */
|
/* check if we've recently seen heartbeat messages from our peers */
|
||||||
BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects<Endpoint>()) {
|
BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects<Endpoint>()) {
|
||||||
if (!endpoint->IsConnected() || endpoint->GetSeen() > Utility::GetTime() - 60)
|
if (!endpoint->IsConnected() || endpoint->GetSeen() > Utility::GetTime() - 300)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Stream::Ptr client = endpoint->GetClient();
|
Stream::Ptr client = endpoint->GetClient();
|
||||||
|
|
||||||
if (client)
|
if (client) {
|
||||||
|
Log(LogWarning, "cluster", "Closing connection for endpoiint '" + endpoint->GetName() + "' due to inactivity.");
|
||||||
client->Close();
|
client->Close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Array::Ptr peers = GetPeers();
|
Array::Ptr peers = GetPeers();
|
||||||
|
|
||||||
|
@ -35,8 +35,6 @@ static void InitializeOpenSSL(void)
|
|||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
|
|
||||||
SSL_COMP_get_compression_methods();
|
|
||||||
|
|
||||||
l_SSLInitialized = true;
|
l_SSLInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user