]> granicus.if.org Git - icinga2/commitdiff
Add missing lock.
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 12 Sep 2013 13:07:37 +0000 (15:07 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 12 Sep 2013 13:07:37 +0000 (15:07 +0200)
components/cluster/clustercomponent.cpp

index be36ad6b84b990526feb43d3d96da5ca30c4db9c..474f36fb668dd182e4ace8ed32b72754f268d658 100644 (file)
@@ -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();