]> granicus.if.org Git - icinga2/commitdiff
Fix checkresults from the future breaking checks
authorJean Flach <jean-marcel.flach@icinga.com>
Fri, 11 Jan 2019 15:16:45 +0000 (16:16 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Fri, 8 Feb 2019 11:08:40 +0000 (12:08 +0100)
lib/icinga/checkable-check.cpp

index 0b8917b77e8e77c6cbff6cd3075d37fce05f4c5b..09fa901e12afa7ea767863adf1988c3b00d264dd 100644 (file)
@@ -170,8 +170,8 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
        long old_attempt = GetCheckAttempt();
        bool recovery = false;
 
-       /* Ignore check results older than the current one. */
-       if (old_cr && cr->GetExecutionStart() < old_cr->GetExecutionStart())
+       /* Ignore check results older than the current one, except if the previous check result is from the future. */
+       if (old_cr && cr->GetExecutionStart() < old_cr->GetExecutionStart() && old_cr->GetExecutionStart() < now)
                return;
 
        /* The ExecuteCheck function already sets the old state, but we need to do it again