Skip to content

Commit 5a6b204

Browse files
authored
Merge pull request #10290 from Icinga/icingadb-dependencies-sync
Sync dependencies to Redis
2 parents d1d649f + bc2c750 commit 5a6b204

15 files changed

Lines changed: 1821 additions & 206 deletions

lib/icinga/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ set(icinga_SOURCES
3939
comment.cpp comment.hpp comment-ti.hpp
4040
compatutility.cpp compatutility.hpp
4141
customvarobject.cpp customvarobject.hpp customvarobject-ti.hpp
42-
dependency.cpp dependency.hpp dependency-ti.hpp dependency-apply.cpp
42+
dependency.cpp dependency-group.cpp dependency.hpp dependency-ti.hpp dependency-apply.cpp
4343
downtime.cpp downtime.hpp downtime-ti.hpp
4444
envresolver.cpp envresolver.hpp
4545
eventcommand.cpp eventcommand.hpp eventcommand-ti.hpp

lib/icinga/checkable-check.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
154154
bool reachable = IsReachable();
155155
bool notification_reachable = IsReachable(DependencyNotification);
156156

157+
// Cache whether the previous state of this Checkable affects its children before overwriting the last check result.
158+
// This will be used to determine whether the on reachability changed event should be triggered.
159+
bool affectsPreviousStateChildren(reachable && AffectsChildren());
160+
157161
ObjectLock olock(this);
158162

159163
CheckResult::Ptr old_cr = GetLastCheckResult();
@@ -533,7 +537,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
533537
}
534538

535539
/* update reachability for child objects */
536-
if ((stateChange || hardChange) && !children.empty())
540+
if ((stateChange || hardChange) && !children.empty() && (affectsPreviousStateChildren || AffectsChildren()))
537541
OnReachabilityChanged(this, cr, children, origin);
538542

539543
return Result::Ok;

0 commit comments

Comments
 (0)