mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 06:34:42 +02:00
Fix deadlock in DbObject::SendVars{Config,Status}Update
fixes #12127 fixes #12085
This commit is contained in:
parent
ca42b4658a
commit
ea57f0045e
@ -161,6 +161,7 @@ void DbObject::SendVarsConfigUpdate(void)
|
|||||||
Dictionary::Ptr vars = CompatUtility::GetCustomAttributeConfig(custom_var_object);
|
Dictionary::Ptr vars = CompatUtility::GetCustomAttributeConfig(custom_var_object);
|
||||||
|
|
||||||
if (vars) {
|
if (vars) {
|
||||||
|
std::vector<DbQuery> queries;
|
||||||
ObjectLock olock (vars);
|
ObjectLock olock (vars);
|
||||||
|
|
||||||
BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
|
BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
|
||||||
@ -196,8 +197,10 @@ void DbObject::SendVarsConfigUpdate(void)
|
|||||||
query.WhereCriteria->Set("varname", kv.first);
|
query.WhereCriteria->Set("varname", kv.first);
|
||||||
query.Object = this;
|
query.Object = this;
|
||||||
|
|
||||||
OnQuery(query);
|
queries.push_back(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OnMultipleQueries(queries);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,6 +216,7 @@ void DbObject::SendVarsStatusUpdate(void)
|
|||||||
Dictionary::Ptr vars = CompatUtility::GetCustomAttributeConfig(custom_var_object);
|
Dictionary::Ptr vars = CompatUtility::GetCustomAttributeConfig(custom_var_object);
|
||||||
|
|
||||||
if (vars) {
|
if (vars) {
|
||||||
|
std::vector<DbQuery> queries;
|
||||||
ObjectLock olock (vars);
|
ObjectLock olock (vars);
|
||||||
|
|
||||||
BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
|
BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
|
||||||
@ -248,8 +252,10 @@ void DbObject::SendVarsStatusUpdate(void)
|
|||||||
query.WhereCriteria->Set("varname", kv.first);
|
query.WhereCriteria->Set("varname", kv.first);
|
||||||
query.Object = this;
|
query.Object = this;
|
||||||
|
|
||||||
OnQuery(query);
|
queries.push_back(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OnMultipleQueries(queries);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user