From: Gunnar Beutner Date: Thu, 12 Sep 2013 13:07:37 +0000 (+0200) Subject: Add missing lock. X-Git-Tag: v0.0.3~540 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e54a96880766014f18f012ca6142fd06abc61bd;p=icinga2 Add missing lock. --- diff --git a/components/cluster/clustercomponent.cpp b/components/cluster/clustercomponent.cpp index be36ad6b8..474f36fb6 100644 --- a/components/cluster/clustercomponent.cpp +++ b/components/cluster/clustercomponent.cpp @@ -1139,6 +1139,7 @@ void ClusterComponent::CheckAuthorityHandler(const DynamicObject::Ptr& object, c continue; if (authorities) { + ObjectLock olock(authorities); BOOST_FOREACH(const String& authority, authorities) { if (Utility::Match(authority, endpoint->GetName())) { match = true; @@ -1156,6 +1157,12 @@ void ClusterComponent::CheckAuthorityHandler(const DynamicObject::Ptr& object, c std::sort(endpoints.begin(), endpoints.end()); + std::ostringstream msgbuf; + BOOST_FOREACH(const String& name, endpoints) { + msgbuf << name << ", "; + } + Log(LogDebug, "cluster", "Responsible for " + object->GetName() + ": " + msgbuf.str()); + String key = object->GetType()->GetName() + "\t" + object->GetName(); unsigned long hash = Utility::SDBM(key); unsigned long index = hash % endpoints.size();