Don't increment check attempt counter on OK->NOT-OK transition

refs #7287

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
This commit is contained in:
Michael Friedrich 2015-02-20 21:30:14 +01:00 committed by Michael Friedrich
parent f198249eb1
commit 05c237c780
1 changed files with 5 additions and 2 deletions

View File

@ -338,9 +338,12 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
} else {
if (old_attempt >= GetMaxCheckAttempts()) {
SetStateType(StateTypeHard);
} else if (old_stateType == StateTypeSoft || old_state == ServiceOK) {
} else if (old_stateType == StateTypeSoft && old_state != ServiceOK) {
SetStateType(StateTypeSoft);
attempt = old_attempt + 1;
attempt = old_attempt + 1; //NOT-OK -> NOT-OK counter
} else if (old_state == ServiceOK) {
SetStateType(StateTypeSoft);
attempt = 1; //OK -> NOT-OK transition, reset the counter
} else {
attempt = old_attempt;
}