monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: depend take 2


From: Jan-Henrik Haukeland
Subject: Re: depend take 2
Date: 21 Dec 2002 00:44:29 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)

Rory Toma <address@hidden> writes:

> It's a tough problem to do cleanly. Once you're done, I'm going to
> see if I can eliminate some redundant code and clean up a bit.

Great! Also if you have time, check out the recursive logic, maybe
it's possible to do this a better way.

> I think the main thing that I'd like to see changed is to have all
> processes when they are going to be stopped/started go thru a single
> piece of logic.

I'm afraid it is going to be non-trivial due to the recursive nature
of the do_start and to some extent do_dependant functions. 

> Hey, I just had a thought. We could change to a 2-pass parse when we
> parse monitrc. The first pass could be on the "check" line, and we
> create all the process entries. The second pass fills in the fields,
> and at that time, p->dependant and p->parent can be filled in. This
> might make things easier.

I got away with doing a post-parse reshuffling of the processlist. It
is now ordered in a dependant manner and it should be possible to
write depend entries anyway you like it in the control file and the
depend code will still work.

> > If you remember the depend matrix gif I sent in a previous mail this
> > code tries to travers (isn't it called that in english?) or follow a
> > depend path in the matrix and mark elements as they are visited and
> > started/stopped in real time. In the old code all processes was not
> > started in real time (the same cycle) but waited for the next monit
> > cycle to pick them up for start.
> 
> This isn't neccessarily true. Here's what would happen:
> *

I see, if you don't mind, you could always test with the old control.c
but keep the depend stuff in the parser which order the processlist,
and if it works with all the test cases (e.g. the one mentioned in the
new man file) I'm not opposed to putting back your code since it's
easier to understand. I think the most important thing I have done was
to order the processlist and to check the depend graph for loops and
false depend names. *But* it seems to work now, doesn't it?

-- 
Jan-Henrik Haukeland



reply via email to

[Prev in Thread] Current Thread [Next in Thread]