mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-26 11:08:51 +02:00
Downtime#TriggerDowntime(): ObjectLock(this), except for other Downtimes
SetRemovalInfo() and Deactivate() already lock themselves like this. The latter calls Stop() which also runs Icinga DB hooks while being locked. This prevents trigger and remove events from malforming each other. Especially Downtimes don't get cancelled during triggering.
This commit is contained in:
parent
9d44d48503
commit
7a359bb150
@ -487,6 +487,8 @@ void Downtime::SetupCleanupTimer()
|
||||
|
||||
void Downtime::TriggerDowntime(double triggerTime)
|
||||
{
|
||||
ObjectLock oLock (this);
|
||||
|
||||
if (!CanBeTriggered())
|
||||
return;
|
||||
|
||||
@ -499,10 +501,9 @@ void Downtime::TriggerDowntime(double triggerTime)
|
||||
SetTriggerTime(triggerTime);
|
||||
}
|
||||
|
||||
{
|
||||
ObjectLock olock (this);
|
||||
SetupCleanupTimer();
|
||||
}
|
||||
SetupCleanupTimer();
|
||||
OnDowntimeTriggered(this);
|
||||
oLock.Unlock();
|
||||
|
||||
Array::Ptr triggers = GetTriggers();
|
||||
|
||||
@ -517,8 +518,6 @@ void Downtime::TriggerDowntime(double triggerTime)
|
||||
downtime->TriggerDowntime(triggerTime);
|
||||
}
|
||||
}
|
||||
|
||||
OnDowntimeTriggered(this);
|
||||
}
|
||||
|
||||
void Downtime::SetRemovalInfo(const String& removedBy, double removeTime, const MessageOrigin::Ptr& origin) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user