mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-29 00:24:23 +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
4e664470b5
commit
97f48759cd
@ -367,7 +367,6 @@ void ApiListener::ApiTimerHandler(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsMaster()) {
|
|
||||||
Zone::Ptr my_zone = Zone::GetLocalZone();
|
Zone::Ptr my_zone = Zone::GetLocalZone();
|
||||||
|
|
||||||
BOOST_FOREACH(const Zone::Ptr& zone, DynamicType::GetObjectsByType<Zone>()) {
|
BOOST_FOREACH(const Zone::Ptr& zone, DynamicType::GetObjectsByType<Zone>()) {
|
||||||
@ -378,22 +377,6 @@ void ApiListener::ApiTimerHandler(void)
|
|||||||
continue;
|
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()) {
|
BOOST_FOREACH(const Endpoint::Ptr& endpoint, zone->GetEndpoints()) {
|
||||||
/* don't connect to ourselves */
|
/* don't connect to ourselves */
|
||||||
if (endpoint->GetName() == GetIdentity()) {
|
if (endpoint->GetName() == GetIdentity()) {
|
||||||
@ -416,11 +399,17 @@ void ApiListener::ApiTimerHandler(void)
|
|||||||
continue;
|
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));
|
boost::thread thread(boost::bind(&ApiListener::AddConnection, this, endpoint));
|
||||||
thread.detach();
|
thread.detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
|
BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
|
||||||
if (!endpoint->IsConnected())
|
if (!endpoint->IsConnected())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user