From: Gunnar Beutner Date: Mon, 2 Jul 2012 09:19:14 +0000 (+0200) Subject: Fixed problem with keeping subscriptions properly synchronized. X-Git-Tag: v0.0.1~336 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9a74ef3ed1be6cdb05f7313672d28f39346187e;p=icinga2 Fixed problem with keeping subscriptions properly synchronized. --- diff --git a/icinga/endpointmanager.cpp b/icinga/endpointmanager.cpp index 04f1face1..7230c2281 100644 --- a/icinga/endpointmanager.cpp +++ b/icinga/endpointmanager.cpp @@ -172,6 +172,21 @@ void EndpointManager::RegisterEndpoint(Endpoint::Ptr endpoint) } else { m_PendingEndpoints.push_back(endpoint); } + + if (endpoint->IsLocal()) { + /* this endpoint might have introduced new subscriptions + * or publications which affect remote endpoints, we need + * to close all fully-connected remote endpoints to make sure + * these subscriptions/publications are kept up-to-date. */ + Iterator prev, it; + for (it = m_Endpoints.begin(); it != m_Endpoints.end(); ) { + prev = it; + it++; + + if (!prev->second->IsLocal()) + m_Endpoints.erase(prev); + } + } } /**