Checkable#ProcessCheckResult(): call Checkable::OnReachabilityChanged last

to ensure Checkable#IsReachable() returns correctly for dependency children inside OnReachabilityChanged().
That needs the dependency parent to be already in the correct state.

refs #9143
This commit is contained in:
Alexander A. Klimov 2022-01-25 11:38:05 +01:00
parent 84d09876b4
commit 4c38715ef2
1 changed files with 4 additions and 8 deletions

View File

@ -215,10 +215,6 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
ResetNotificationNumbers();
SaveLastState(ServiceOK, cr->GetExecutionEnd());
/* update reachability for child objects in OK state */
if (!children.empty())
OnReachabilityChanged(this, cr, children, origin);
} else {
/* OK -> NOT-OK change, first SOFT state. Reset attempt counter. */
if (IsStateOK(old_state)) {
@ -241,10 +237,6 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
if (!IsStateOK(cr->GetState())) {
SaveLastState(cr->GetState(), cr->GetExecutionEnd());
}
/* update reachability for child objects in NOT-OK state */
if (!children.empty())
OnReachabilityChanged(this, cr, children, origin);
}
if (recovery) {
@ -514,6 +506,10 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
SetSuppressedNotifications(suppressed_types_after);
}
}
/* update reachability for child objects */
if (!children.empty())
OnReachabilityChanged(this, cr, children, origin);
}
void Checkable::ExecuteRemoteCheck(const Dictionary::Ptr& resolvedMacros)