[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: monit restart bug/race condition (3.1 and current CVS version behav
From: |
Jan-Henrik Haukeland |
Subject: |
Re: monit restart bug/race condition (3.1 and current CVS version behavior) |
Date: |
09 Feb 2003 22:37:34 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service) |
Martin Pala <address@hidden> writes:
[..]
> You can replicate the problem easily when you let monit run in
> daemon mode and wakeup every 1s.
I think we will need to add a restart action to check_process() which
does the restart in one atomic operation (instead of the current
check_process(stop) -> wait -> check_process(start). That is, call
do_stop -> do_start in sequence in check_process(). And to avoid any
race condition (if the monit daemon thread has a low poll frequency)
use an action-mutex so only one thread can execute an action in
check_process() at the same time.
Something like
check_process(P, restart) {
LOCK(action_mutex)
do_stop(P);
do_start(P);
END_LOCK;
}
I can look into it, so you can concentrate on the device stuff :-)
--
Jan-Henrik Haukeland