Merge pull request #8676 from Icinga/bugfix/icingadb-delta-segv

IcingaDB#UpdateAllConfigObjects(): don't modify map concurrently
This commit is contained in:
Julian Brost 2021-03-09 09:12:03 +01:00 committed by GitHub
commit 160d0ea371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -367,9 +367,9 @@ void IcingaDB::UpdateAllConfigObjects()
std::map<String, std::map<String, String>> ourContent;
for (auto& source : ourContentRaw) {
upqObjectType.Enqueue([&]() {
auto& dest (ourContent[source.first]);
auto& dest (ourContent[source.first]);
upqObjectType.Enqueue([&]() {
for (auto& hMSet : source.second) {
for (decltype(hMSet.size()) i = 0, stop = hMSet.size() - 1u; i < stop; i += 2u) {
dest.emplace(std::move(hMSet[i]), std::move(hMSet[i + 1u]));