8 Commits

Author SHA1 Message Date
Yonas Habteab
27e0bb2546 Introduce DependencyGroups debugging HTTP endpoint 2025-03-13 13:57:07 +01:00
Yonas Habteab
9360fb14fa Evaluate dependency group state only for a specific child
Previously the dependency state was evaluated by picking the first
dependency object from the batched members. However, since the
dependency `disable_{checks,notifications` attributes aren't taken into
account when batching the members, the evaluated state may yield a wrong
result for some Checkables due to some random dependency from other
Checkable of that group that has the `disable_{checks,notifications`
attrs set. This commit forces the callers to always provide the child
Checkable the state is evaluated for and picks only the dependency
objects of that child Checkable.
2025-03-12 16:32:44 +01:00
Julian Brost
b4789f4f07 Simplify DependencyGroup::GetState() implementation
The new implementation just counts reachable and available parents and
determines the overall result by comparing numbers, see inline comments for
more information.

This also fixes an issue in the previous implementation: if it didn't return
early from the loop, it would just return the state of the last parent
considered which may not actually represent the group state accurately.
2025-03-12 16:32:44 +01:00
Yonas Habteab
4f38a0e223 Checkable: Extract parents directly from dependency groups 2025-03-12 16:32:44 +01:00
Yonas Habteab
94d7c4ffa6 Checkable: Emit boost signals when changing dependency groups at runtime 2025-03-12 16:32:44 +01:00
Julian Brost
ec83515e59 Simplify dependency group registration
Co-Authored-By: Yonas Habteab <yonas.habteab@icinga.com>
2025-03-12 16:32:42 +01:00
Yonas Habteab
1820955993 Add DependencyGroup::GetState() helper method 2025-03-12 16:31:14 +01:00
Yonas Habteab
d7c9e6687e Introduce DependencyGroup helper class 2025-03-12 16:31:12 +01:00