REGISTER_APIFUNCTION(Update, config, &ApiListener::ConfigUpdateHandler);
+boost::mutex ApiListener::m_ConfigSyncStageLock;
+
void ApiListener::ConfigGlobHandler(ConfigDirInformation& config, const String& path, const String& file)
{
CONTEXT("Creating config update for file '" + file + "'");
return Empty;
}
+ /* Only one transaction is allowed, concurrent message handlers need to wait.
+ * This affects two parent endpoints sending the config in the same moment.
+ */
+ boost::mutex::scoped_lock lock(m_ConfigSyncStageLock);
+
Log(LogInformation, "ApiListener")
<< "Applying config update from endpoint '" << origin->FromClient->GetEndpoint()->GetName()
<< "' of zone '" << GetFromZoneName(origin->FromZone) << "'.";
void RemoveStatusFile();
/* filesync */
+ static boost::mutex m_ConfigSyncStageLock;
+
static ConfigDirInformation LoadConfigDir(const String& dir);
static Dictionary::Ptr MergeConfigUpdate(const ConfigDirInformation& config);
static bool UpdateConfigDir(const ConfigDirInformation& oldConfig, const ConfigDirInformation& newConfig, const String& configDir, bool authoritative);