mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
Checkable: Don't always trigger reachablity changed signal
But only when the current check result being processed affects the child Checkables in any way.
This commit is contained in:
parent
c64ae1af0f
commit
772420a438
@ -154,6 +154,10 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
|||||||
bool reachable = IsReachable();
|
bool reachable = IsReachable();
|
||||||
bool notification_reachable = IsReachable(DependencyNotification);
|
bool notification_reachable = IsReachable(DependencyNotification);
|
||||||
|
|
||||||
|
// Cache whether the previous state of this Checkable affects its children before overwriting the last check result.
|
||||||
|
// This will be used to determine whether the on reachability changed event should be triggered.
|
||||||
|
bool affectsPreviousStateChildren(reachable && AffectsChildren());
|
||||||
|
|
||||||
ObjectLock olock(this);
|
ObjectLock olock(this);
|
||||||
|
|
||||||
CheckResult::Ptr old_cr = GetLastCheckResult();
|
CheckResult::Ptr old_cr = GetLastCheckResult();
|
||||||
@ -533,7 +537,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* update reachability for child objects */
|
/* update reachability for child objects */
|
||||||
if ((stateChange || hardChange) && !children.empty())
|
if ((stateChange || hardChange) && !children.empty() && (affectsPreviousStateChildren || AffectsChildren()))
|
||||||
OnReachabilityChanged(this, cr, children, origin);
|
OnReachabilityChanged(this, cr, children, origin);
|
||||||
|
|
||||||
return Result::Ok;
|
return Result::Ok;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user