Array::Ptr configFiles = endpoint->GetConfigFiles();
if (configFiles) {
+ ObjectLock olock(configFiles);
BOOST_FOREACH(const String& pattern, configFiles) {
Utility::Glob(pattern, boost::bind(&ClusterComponent::ConfigGlobHandler, boost::cref(config), _1, false));
}
BOOST_FOREACH(const String& peer, peers) {
Endpoint::Ptr endpoint = Endpoint::GetByName(peer);
- if (!endpoint)
+ if (!endpoint) {
+ Log(LogWarning, "cluster", "Attempted to reconnect to endpoint '" + peer + "': No configuration found.");
continue;
+ }
if (endpoint->IsConnected())
continue;
bool accept = false;
if (acceptConfig) {
+ ObjectLock olock(acceptConfig);
BOOST_FOREACH(const String& pattern, acceptConfig) {
if (Utility::Match(pattern, sender->GetName())) {
accept = true;
String key;
Value value;
+ ObjectLock olock(remoteConfig);
BOOST_FOREACH(boost::tie(key, value), remoteConfig) {
Dictionary::Ptr remoteFile = value;
bool writeFile = false;
localConfig->Remove(hash);
}
+ ObjectLock olock2(localConfig);
BOOST_FOREACH(boost::tie(key, boost::tuples::ignore), localConfig) {
String path = dir + "/" + key;
Log(LogInformation, "cluster", "Removing obsolete config file: " + path);
*/
void CompatLog::Start(void)
{
+ DynamicObject::Start();
+
Service::OnNewCheckResult.connect(bind(&CompatLog::CheckResultHandler, this, _1, _2));
// Service::OnDowntimeTriggered.connect(bind(&CompatLog::DowntimeHandler, this, _1));
Service::OnNotificationSentChanged.connect(bind(&CompatLog::NotificationSentHandler, this, _1, _2, _3, _4, _5, _6));