From: Gunnar Beutner Date: Mon, 1 Apr 2013 15:21:57 +0000 (+0200) Subject: Fix deadlock in ReplicationComponent::EndpointConnectedHandler. X-Git-Tag: v0.0.2~160 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=acfa3e6475ba22c4bf60028978acdf3bed098ea4;p=icinga2 Fix deadlock in ReplicationComponent::EndpointConnectedHandler. --- diff --git a/components/replication/replicationcomponent.cpp b/components/replication/replicationcomponent.cpp index 899cd5cf5..b8d252593 100644 --- a/components/replication/replicationcomponent.cpp +++ b/components/replication/replicationcomponent.cpp @@ -87,28 +87,19 @@ void ReplicationComponent::CheckResultRequestHandler(const RequestMessage& reque void ReplicationComponent::EndpointConnectedHandler(const Endpoint::Ptr& endpoint) { - { - ObjectLock olock(endpoint); - - /* no need to sync the config with local endpoints */ - if (endpoint->IsLocalEndpoint()) - return; + /* no need to sync the config with local endpoints */ + if (endpoint->IsLocalEndpoint()) + return; - /* we just assume the other endpoint wants object updates */ - endpoint->RegisterSubscription("config::ObjectUpdate"); - endpoint->RegisterSubscription("config::ObjectRemoved"); - } + /* we just assume the other endpoint wants object updates */ + endpoint->RegisterSubscription("config::ObjectUpdate"); + endpoint->RegisterSubscription("config::ObjectRemoved"); DynamicType::Ptr type; BOOST_FOREACH(const DynamicType::Ptr& dt, DynamicType::GetTypes()) { std::set objects; - { - ObjectLock olock(dt); - objects = dt->GetObjects(); - } - - BOOST_FOREACH(const DynamicObject::Ptr& object, objects) { + BOOST_FOREACH(const DynamicObject::Ptr& object, dt->GetObjects()) { if (!ShouldReplicateObject(object)) continue;