monit-dev
[Top][All Lists]
Advanced

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

monit restart bug/race condition (3.1 and current CVS version behavior)


From: Martin Pala
Subject: monit restart bug/race condition (3.1 and current CVS version behavior)
Date: Sun, 09 Feb 2003 19:38:37 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021226 Debian/1.2.1-9

Hi,

there's bug in monit since 3.1 - if monit is running in daemon mode and you want to restart the service by executing (for example):

unicorn:~#monit restart slapd

you get following output in monit's log:

Feb  9 19:03:25 unicorn monit[3157]: stop: (slapd) /etc/init.d/slapd
Feb  9 19:03:26 unicorn monit[3155]: 'slapd' have valid checksums
Feb  9 19:03:26 unicorn monit[3155]: start: (slapd) /etc/init.d/slapd
Feb 9 19:03:26 unicorn monit[3157]: monit: Warning process 'slapd' was not stopped
Feb  9 19:03:26 unicorn monit[3157]: Monitoring disabled -- process slapd

(Legend: 3155=monit main thread, 3157=monit httpd thread)

Since that, slapd isn't monitored anymore but it is running.

Problem is, that monit calls stop method via monit httpd and waits for process termination. As soon as process is stopped, main thread detects it and start it again. Because process is started again, stop method runned by monit httpd in parallel will fail => it will disable monitoring (it affects common monit runtime environment). The result is, that the service is running, but not monitored.

You can replicate the problem easily when you let monit run in daemon mode and wakeup every 1s.

I think Oliver saw this problem and his patch has workaround for it, which will work fine, but probably it will be better to solve the race condition itself. What about it (would someone look on it or shall i do it :) ?

Cheers,
Martin






reply via email to

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