]> granicus.if.org Git - icinga2/commitdiff
Revert "Revert "cluster: Disconnect timed out endpoints.""
authorGunnar Beutner <gunnar@beutner.name>
Wed, 11 Sep 2013 05:49:43 +0000 (07:49 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 11 Sep 2013 05:49:43 +0000 (07:49 +0200)
This reverts commit 0cab8827311db265a8458236ef97b3f9640e9ca8.

components/cluster/clustercomponent.cpp

index 220548b899e85b5aafca5832bf195c70e37f5eef..fdb36ac0174d99e36fce3fb78d1e14f327766115 100644 (file)
@@ -450,6 +450,17 @@ void ClusterComponent::ClusterTimerHandler(void)
 
        RelayMessage(Endpoint::Ptr(), message, false);
 
+       /* check if we've recently seen heartbeat messages from our peers */
+       BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects<Endpoint>()) {
+               if (!endpoint->IsConnected() || endpoint->GetSeen() > Utility::GetTime() - 60)
+                       continue;
+
+               Stream::Ptr client = endpoint->GetClient();
+
+               if (client)
+                       client->Close();
+       }
+
        Array::Ptr peers = GetPeers();
 
        if (!peers)