-
Notifications
You must be signed in to change notification settings - Fork 581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checkable: Don't skip redundancy group checks for parent dependencies #10228
base: master
Are you sure you want to change the base?
Conversation
4ad59ed
to
492621a
Compare
lib/icinga/checkable-dependency.cpp
Outdated
std::string redundancy_group = dep->GetRedundancyGroup(); | ||
bool parentReachable{true}; | ||
if (Checkable::Ptr parent = dep->GetParent(); parent.get() != this) { | ||
parentReachable = parent->IsReachable(dt, failedDependency, rstack + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Admittedly other construction area, but while on it, you could increment rstack just once before the loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, because currently the sum of all direct and intermediate dependencies is limited to 256
. You want me to change this so that the limit applies to each dependency object individually? I can do this, but as you already said, it's not related to this issue.
492621a
to
ddc9e46
Compare
ddc9e46
to
cab27fc
Compare
cab27fc
to
af33327
Compare
Previously, all parent dependencies were recursively checked right at the beginning of `Checkable::IsReachable()` for reachability and immediately returned `false` if one of them fails. However, since the introduction of `redundancy_group`, that failed parent might be within a redundancy group, which shouldn't necessarily cause the dependency to fail completely. This PR changes this insofar as not all parents are checked at the beginning of the method, but only a single parent per a dependency object is evaluated.
af33327
to
d7936cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Previously, all parent dependencies were recursively checked right at the beginning of
Checkable::IsReachable()
for reachability and immediately returnedfalse
if one of them fails. However, since the introduction ofredundancy_group
, that failed parent might be within a redundancy group, which shouldn't necessarily cause the dependency to fail completely. This PR changes this insofar as not all parents are checked at the beginning of the method, but only a single parent per a dependency object is evaluated.Tests
Icinga 2 Config
Before
Now, change the dummy state for the
mother
Host tovars.dummy_state = 0
.After
Now, change the dummy state for the
mother
Host tovars.dummy_state = 0
.fixes #10014