From 4e54a96880766014f18f012ca6142fd06abc61bd Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 12 Sep 2013 15:07:37 +0200 Subject: [PATCH] Add missing lock. --- components/cluster/clustercomponent.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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();