mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-20 20:24:33 +02:00
Fix deadlock in ReplicationComponent::EndpointConnectedHandler.
This commit is contained in:
parent
b3acd768eb
commit
acfa3e6475
@ -87,28 +87,19 @@ void ReplicationComponent::CheckResultRequestHandler(const RequestMessage& reque
|
|||||||
|
|
||||||
void ReplicationComponent::EndpointConnectedHandler(const Endpoint::Ptr& endpoint)
|
void ReplicationComponent::EndpointConnectedHandler(const Endpoint::Ptr& endpoint)
|
||||||
{
|
{
|
||||||
{
|
/* no need to sync the config with local endpoints */
|
||||||
ObjectLock olock(endpoint);
|
if (endpoint->IsLocalEndpoint())
|
||||||
|
return;
|
||||||
|
|
||||||
/* no need to sync the config with local endpoints */
|
/* we just assume the other endpoint wants object updates */
|
||||||
if (endpoint->IsLocalEndpoint())
|
endpoint->RegisterSubscription("config::ObjectUpdate");
|
||||||
return;
|
endpoint->RegisterSubscription("config::ObjectRemoved");
|
||||||
|
|
||||||
/* we just assume the other endpoint wants object updates */
|
|
||||||
endpoint->RegisterSubscription("config::ObjectUpdate");
|
|
||||||
endpoint->RegisterSubscription("config::ObjectRemoved");
|
|
||||||
}
|
|
||||||
|
|
||||||
DynamicType::Ptr type;
|
DynamicType::Ptr type;
|
||||||
BOOST_FOREACH(const DynamicType::Ptr& dt, DynamicType::GetTypes()) {
|
BOOST_FOREACH(const DynamicType::Ptr& dt, DynamicType::GetTypes()) {
|
||||||
std::set<DynamicObject::Ptr> objects;
|
std::set<DynamicObject::Ptr> objects;
|
||||||
|
|
||||||
{
|
BOOST_FOREACH(const DynamicObject::Ptr& object, dt->GetObjects()) {
|
||||||
ObjectLock olock(dt);
|
|
||||||
objects = dt->GetObjects();
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_FOREACH(const DynamicObject::Ptr& object, objects) {
|
|
||||||
if (!ShouldReplicateObject(object))
|
if (!ShouldReplicateObject(object))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user