[Top][All Lists]

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

RE: Question on the dependency of processes

From: Yiwen Jiang
Subject: RE: Question on the dependency of processes
Date: Wed, 23 Mar 2005 12:05:57 -0500

Hi there,

Sorry for the delayed response.... Busy with product delivery dates.

> On Mar 14, 2005, at 15:38, Yiwen Jiang wrote:
> > I am not sure if this is the proper news group that I
> should post this
> > question to, as there are monit implementation questions in this
> > email...
> You should really take implementation issues to the monit-developer
> list. But..
K. This message is an attempt to bridge this topic over to the dev group.
> > What I have found was that the order in the monitrc file for
> > monitoring these proceeses generate different 'servicelist' content
> > (in the source code). For example, the content of
> servicelist (when in
> > validate.c::validate() to check for zombie processes) is
> different if
> > the processes are listed in reverse order in the monitrc file.
> >
> > For example, say I have a service dependency tree like:
> > E->D->C->B->A
> > F->D->C->B->A
> > G->A
> > Where as A is the 'root of the tree.
> >
> >  In my monitrc file, I have 'check process' in the
> following order: E,
> > F, D, C, B, G, A.
> >
> >  If I turn debug on using -v option, the checks on the zombie
> > processes are in the order of: G, F, E, D, C, B, A
> >
> >  If I reverse the order in the monitrc file, and restart monit using
> > -v option, the checks on the zombie processes are in the
> order of: E,
> > F, D, C, B, G, A. This is in a different result than the
> previous one.
> The list is initially built during parsing and reshuffled
> afterwards if
> dependencies are present. Because of this the final list may look
> different if you change the order of the service entries.
> Note however
> that in both cases the reshuffling is done so the leaf nodes
> are first
> in the list.
> > I went through the code, and noticed that the 'servicelist' is
> > actually re-organized based on the dependencies after the
> > configuration file is parsed.. However, the result yield the most
> > visited process to be the last on the servicelist.
> >
> >  I don't quite understand why the the most visited process is not at
> > the beginning of the list. If my understanding is correct, validate
> > goes through the servicelist, to check process status every poll
> > interval. If we think of a scenario where because process A
> crashed,
> > process G exited. The current behaviour will result in G being
> > restarted before A, despite the dependency.
> Hmm you have a point there, although the end result should be
> the same
> it seems that you got one unnecessary restart of G. Have you verified
> that this is the case? Browsing the code it does indeed look that way.

Well, it is not the unnecessary restart of G that I'm concerned about (actually, I didn't notice that one at all). You see, the product I am working on is heavily depends on the process dependencies and start up order. In this product, if G detects A is down, it will exit as well. The way monit works, if I understand correctly, is that it will detect G being down first, and restart G. I have observed that the startup time dramatically increases when G is started before A, even though it is A that crashed.  Is this the expected behaviour?

> >  Would it not make more sense to have the servicelist
> constructed the
> > other way where the most dependent process be the first
> process on the
> > servicelist?
> >
> > Because of the dependencies between these processes, it really only
> > make sense to me if monit would check for the 'root'
> process first. Or
> > am I mis-using monit?
> I don't remember why we ended up having the service list with
> the least
> depending services first. It may be other scenarios that justify this
> design, although no one comes to mind right now. Could you
> implement a
> test case with the most depending services first in the list
> and verify
> that dependencies continue to work as described in the monit
> manual? If
This will take some time, due to the way my development environment works, plus work schedule. I will try though.

> it does, we'll certainly reverse the service list and accept a patch
> from you or fix it ourself.
What would happen if the test case fails? Shouldn't monit behaves 'properly' (i.e. start the dead process that is closest to the trunk of the dependency tree first)?

Thank you VERY MUCH for your help.
> --
> Jan-Henrik Haukeland
> Mobil +47 97141255
> --
> To unsubscribe:

reply via email to

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