Page 1 of 1

[PATCH 4/4] fix flexible downtime on service hard state change doesn't get triggered/activated

Posted: Sat Apr 30, 2011 11:11 am
by Guest
This is a multi-part message in MIME format.
--------------030609040200050203090804
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

hi,

since there was no further comments on those patches, i did a revision
after moving to svn. because there isn't any official git mirror yet,
i'm using http://git.weiss.in-berlin.de/repositories/nagios.git and
latest HEAD.

please refer to the already written threads for further information on
the patches themselves.


OLD

[PATCH] core: fix race condition on flexible downtime commands when duration not set or zero

=> added changelog entry
0001-fix-race-condition-on-flexible-downtime-commands-whe.patch

[PATCH] sanitize compiler warnings on size_t in common/macros.c

=> left as it is, re-applied against head.
0002-sanitize-compiler-warnings-on-size_t-in-common-macro.patch

[PATCH] move thread safe macro function prototypes with suffix _r and restore old compatible prototypes again

=> verified against latest t-tap tests, updated .gitignore
0003-move-thread-safe-macro-function-prototypes-with-suff.patch

=====

NEW

fix flexible downtime on service hard state change doesn't get triggered/activated

recently, there was a change on flexible downtime triggering,
allowing soft state changes to active a flexible downtime.

this change removed the condition on hard_state_change check,
so it only triggered those from soft state changes but not
the well known older behavior.

the tricky part is, that those 2 vars are not the same on each
state change, so the replacement fix needs a sanitized "near-by"
addin, which this patch introduces.

this bug has been evaluated and debugged in deep, the fix
now runs>2 months on productive systems, allowing us to
trigger flexible downtimes on hard state changes too, next
to the soft state changes being detected.

please check https://dev.icinga.org/issues/1228 for a deeper
analysis on this.


0004-fix-flexible-downtime-on-service-hard-state-change-d.patch

=====

the new patch is one of those i mentioned from my todo list. please consider them for future releases as it will ease the porting-patches-from-icinga-core procedure.

kind regards,
Michael



--
DI (FH) Michael Friedrich

Vienna University Computer Center
Universitaetsstrasse 7 A-1010 Vienna, Austria

email: [email protected]
phone: +43 1 4277 14359
mobile: +43 664 60277 14359
fax: +43 1 4277 14338
web: http://www.univie.ac.at/zid
http://www.aco.net

Icinga Core& IDOUtils Developer
http://www.icinga.org



--------------030609040200050203090804
Content-Type: text/x-diff;
name="0001-fix-race-condition-on-flexible-downtime-commands-whe.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*0="0001-fix-race-condition-on-flexible-downtime-commands-whe.pa";
filename*1="tch"

From b955ff8624a298e374fc713fb359b6d70cdcc48e Mon Sep 17 00:00:00 2001
From: Michael Friedrich
Date: Sat, 30 Apr 2011 13:35:59 +0200
Subject: [PATCH 1/4] fix race condition on flexible downtime commands when duration not set or zero

it may happen that an external command sets a
flexible downtime with duration not set or zero.

a flexible downtime is triggered between start and
end time and needs a duration to be set and non zero.

without the fix, the scheduled downtime starts and then
tries to calculate the end time out of the set duration
for the downtime and scheduling a new event.
the time passed over there is in the past, and causes the
core to get into a loop.

to prevent this misbehavior, a duration of null or zero is
not allowed and triggered as error in base/commands.c not
setting any flexible downtime.
---
Changelog | 1 +
base/commands.c | 11 +++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/Changelog b/Changelog
index c767649..299f306 100644
--- a/Changelog
+++ b/Changelog
@@ -22,6 +22,7 @@ FIXES
* Fixed bug with passive host checks being incorrectly sent to event brokers as active checks
* Fixed bug where passive host check status updates were not

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]