Page 1 of 1

[PATCH] Hopefully more accurate patch for maintaining the correct =

Posted: Fri Sep 17, 2010 5:39 pm
by Guest

--7ZAtKRhVyVSsbBD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Sep 10, 2010 at 02:21:50PM +0100, Ton Voon said:
> On 10 Sep 2010, at 13:51, Sven Nierlein wrote:
>
> >> I changed the max_parallel_service_checks to 2 and svc2 is still not
> >> getting rescheduled.
> >>
> >> So can anyone confirm if either the current code:
> >> * causes breakage or
> >> * means that the test is now invalid and svc2->next_check should ==
> >> now
> >
> > Ok, then i can confirm that current code breaks disabling active
> > host/service checks and the
> > test is still valid.
>
> I think this is sufficient to remove the change. Done in CVS now. The
> test passes on my system now, so will see what the other tinerbox
> builds say tomorrow.

Hello,

I think the attached patch addresses the problem slightly more
accurately than the original patch, logic in the attachment. If it's
unclear or outright wrong, please let me know.

Cheers,
--
--------------------------------------------------------------------------
| Stephen Gran | A man always remembers his first love |
| [email protected] | with special tenderness, but after that |
| http://www.lobefin.net/~steve | begins to bunch them. -- Mencken |
--------------------------------------------------------------------------

--7ZAtKRhVyVSsbBD2
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="0001-Hopefully-more-accurate-patch-for-maintaining-the-co.patch"
Content-Transfer-Encoding: quoted-printable

=46rom a9343c4c0d64f71346600e32bd98cd2eccd21bc1 Mon Sep 17 00:00:00 2001
=46rom: Stephen Gran
Date: Fri, 17 Sep 2010 19:16:52 +0100
Subject: [PATCH] Hopefully more accurate patch for maintaining the correct =
value for run_event.

This looks like the intent of the original patch resetting run_event
to TRUE. run_event is used to decide whether to run events, whether
they are service or host checks, but the block evaluating whether to run
checks is potentially destructive, ie, the block that determines whether
to run a service check can change the event list, so that the next block
is entered as well. The correct way to deal with this is not to reset
the variable, but to make sure that the next block is not entered.

Signed-off-by: Stephen Gran
---
base/events.c | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/base/events.c b/base/events.c
index 0c9a91b..d7fd9a7 100644
--- a/base/events.c
+++ b/base/events.c
@@ -1082,16 +1082,7 @@ int event_execution_loop(void){
run_event=3DFALSE;
}
=20
- }
-
- /* Removed. Reports that if you disable all service checks, service che=
cks continue to be run. Also
- t-tap/test_events will fail if this flag is set - TV
- */
- /* reset flag */
- /* run_event=3DTRUE; */
-
- /* run a few checks before executing a host check... */
- if(event_list_low->event_type=3D=3DEVENT_HOST_CHECK){
+ } else if(event_list_low->event_type=3D=3DEVENT_HOST_CHECK){
=20
temp_host=3D(host *)event_list_low->event_data;
=20
--=20
1.7.1


--7ZAtKRhVyVSsbBD2--





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