mirror of https://github.com/Icinga/icinga2.git
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);
|
||||
|
||||
if (vars) {
|
||||
std::vector<DbQuery> queries;
|
||||
ObjectLock olock (vars);
|
||||
|
||||
BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
|
||||
|
@ -196,8 +197,10 @@ void DbObject::SendVarsConfigUpdate(void)
|
|||
query.WhereCriteria->Set("varname", kv.first);
|
||||
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);
|
||||
|
||||
if (vars) {
|
||||
std::vector<DbQuery> queries;
|
||||
ObjectLock olock (vars);
|
||||
|
||||
BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
|
||||
|
@ -248,8 +252,10 @@ void DbObject::SendVarsStatusUpdate(void)
|
|||
query.WhereCriteria->Set("varname", kv.first);
|
||||
query.Object = this;
|
||||
|
||||
OnQuery(query);
|
||||
queries.push_back(query);
|
||||
}
|
||||
|
||||
OnMultipleQueries(queries);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue