mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
Fix deadlock in Service::RemoveDowntime().
This commit is contained in:
parent
1de88b0559
commit
8683a0834f
@ -116,7 +116,7 @@ String Service::AddDowntime(const String& comment_id,
|
|||||||
l_DowntimesCache[uid] = GetSelf();
|
l_DowntimesCache[uid] = GetSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
OnDowntimeAdded(GetSelf(), downtime, authority);
|
Utility::QueueAsyncCallback(bind(boost::ref(OnDowntimeAdded), GetSelf(), downtime, authority));
|
||||||
|
|
||||||
return uid;
|
return uid;
|
||||||
}
|
}
|
||||||
@ -133,13 +133,12 @@ void Service::RemoveDowntime(const String& id, const String& authority)
|
|||||||
if (!downtimes)
|
if (!downtimes)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ObjectLock olock(owner);
|
|
||||||
|
|
||||||
Dictionary::Ptr downtime = downtimes->Get(id);
|
Dictionary::Ptr downtime = downtimes->Get(id);
|
||||||
|
|
||||||
|
if (!downtime)
|
||||||
|
return;
|
||||||
|
|
||||||
String comment_id = downtime->Get("comment_id");
|
String comment_id = downtime->Get("comment_id");
|
||||||
|
|
||||||
RemoveComment(comment_id);
|
|
||||||
|
|
||||||
int legacy_id = downtime->Get("legacy_id");
|
int legacy_id = downtime->Get("legacy_id");
|
||||||
|
|
||||||
@ -150,8 +149,10 @@ void Service::RemoveDowntime(const String& id, const String& authority)
|
|||||||
l_LegacyDowntimesCache.erase(legacy_id);
|
l_LegacyDowntimesCache.erase(legacy_id);
|
||||||
l_DowntimesCache.erase(id);
|
l_DowntimesCache.erase(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RemoveComment(comment_id);
|
||||||
|
|
||||||
OnDowntimeRemoved(owner, downtime, authority);
|
Utility::QueueAsyncCallback(bind(boost::ref(OnDowntimeRemoved), owner, downtime, authority));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Service::TriggerDowntimes(void)
|
void Service::TriggerDowntimes(void)
|
||||||
@ -201,7 +202,7 @@ void Service::TriggerDowntime(const String& id)
|
|||||||
TriggerDowntime(tid);
|
TriggerDowntime(tid);
|
||||||
}
|
}
|
||||||
|
|
||||||
OnDowntimeTriggered(owner, downtime);
|
Utility::QueueAsyncCallback(bind(boost::ref(OnDowntimeTriggered), owner, downtime));
|
||||||
}
|
}
|
||||||
|
|
||||||
String Service::GetDowntimeIDFromLegacyID(int id)
|
String Service::GetDowntimeIDFromLegacyID(int id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user