mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
Merge pull request #9740 from Icinga/freeze-globals
Freeze globals namespace during config load
This commit is contained in:
commit
82f9e4312d
@ -247,6 +247,11 @@ bool DaemonUtility::LoadConfigFiles(const std::vector<std::string>& configs,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// After evaluating the top-level statements of the config files (happening in ValidateConfigFiles() above),
|
||||||
|
// prevent further modification of the global scope. This allows for a faster execution of the following steps
|
||||||
|
// as Freeze() disables locking as it's not necessary on a read-only data structure anymore.
|
||||||
|
ScriptGlobal::GetGlobals()->Freeze();
|
||||||
|
|
||||||
WorkQueue upq(25000, Configuration::Concurrency);
|
WorkQueue upq(25000, Configuration::Concurrency);
|
||||||
upq.SetName("DaemonUtility::LoadConfigFiles");
|
upq.SetName("DaemonUtility::LoadConfigFiles");
|
||||||
bool result = ConfigItem::CommitItems(ascope.GetContext(), upq, newItems);
|
bool result = ConfigItem::CommitItems(ascope.GetContext(), upq, newItems);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user