mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Remove selective reconnecting behavior
We want to remove the partial reconnecting behavior, so that all endpoints of a zone try to connect to a lower or higher zone in hierarchy. fixes #9406 Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
This commit is contained in:
parent
cfcb8675c7
commit
cfbe82d841
@ -368,7 +368,6 @@ void ApiListener::ApiTimerHandler(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (IsMaster()) {
|
||||
Zone::Ptr my_zone = Zone::GetLocalZone();
|
||||
|
||||
BOOST_FOREACH(const Zone::Ptr& zone, DynamicType::GetObjectsByType<Zone>()) {
|
||||
@ -379,22 +378,6 @@ void ApiListener::ApiTimerHandler(void)
|
||||
continue;
|
||||
}
|
||||
|
||||
bool connected = false;
|
||||
|
||||
BOOST_FOREACH(const Endpoint::Ptr& endpoint, zone->GetEndpoints()) {
|
||||
if (endpoint->IsConnected()) {
|
||||
connected = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* don't connect to an endpoint if we already have a connection to the zone */
|
||||
if (connected) {
|
||||
Log(LogDebug, "ApiListener")
|
||||
<< "Not connecting to Zone '" << zone->GetName() << "' because we're already connected to it.";
|
||||
continue;
|
||||
}
|
||||
|
||||
BOOST_FOREACH(const Endpoint::Ptr& endpoint, zone->GetEndpoints()) {
|
||||
/* don't connect to ourselves */
|
||||
if (endpoint->GetName() == GetIdentity()) {
|
||||
@ -417,11 +400,17 @@ void ApiListener::ApiTimerHandler(void)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* don't try to connect if we're already connected */
|
||||
if (endpoint->IsConnected()) {
|
||||
Log(LogDebug, "ApiListener")
|
||||
<< "Not connecting to Endpoint '" << endpoint->GetName() << "' because we're already connected to it.";
|
||||
continue;
|
||||
}
|
||||
|
||||
boost::thread thread(boost::bind(&ApiListener::AddConnection, this, endpoint));
|
||||
thread.detach();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
|
||||
if (!endpoint->IsConnected())
|
||||
|
Loading…
x
Reference in New Issue
Block a user