From 6414fd19f57e6a24c23075ab17ff223690f89de4 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Fri, 3 Mar 2023 12:07:37 +0100 Subject: [PATCH] Checkable#ProcessCheckResult(): only clean up ack comments older than check result Normally if for some reason an ack comment still exists on a checkable not acked anymore, still clean it up. But while replaying log config objects incl. ack comments come before check results and acks. I.e. 1) ack comment, 2) DOWN check result and 3) ack. Not 1) DOWN check result, 2) ack and 3) ack comment. So the checkable is temporarily not acked, but already has the ack comment. In this case the DOWN check result which is older than the ack comment shall not clean up the latter. --- lib/icinga/checkable-check.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp index ea2428588..efa9477a2 100644 --- a/lib/icinga/checkable-check.cpp +++ b/lib/icinga/checkable-check.cpp @@ -321,7 +321,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr olock.Unlock(); if (remove_acknowledgement_comments) - RemoveAckComments(); + RemoveAckComments(String(), cr->GetExecutionEnd()); Dictionary::Ptr vars_after = new Dictionary({ { "state", new_state },