On 27. jun. 2006, at 15.36, Martin Pala wrote:

Description of the patch:

When some action is requested via http, the http thread just sets the "doaction" task on the given service thread and wakes up the main thread. The main thread then performs normal testing cycle and when it founds the doaction flag on any service, it performs the requested action.

From the patch

+++ validate.c  27 Jun 2006 11:38:58 -0000
+      if(s->doaction != ACTION_IGNORE) {
+        control_service(s->name, s->doaction);
+        s->doaction = ACTION_IGNORE;
+      } else if(s->monitor && !check_skip(s) && !check_timeout(s)) {

I think it may be better to run a new for-loop first and only check and act on the doaction flag or merge the if-else. In the code above, services with this flag set is excluded from the standard test (in the else part), which probably is not what we want.

Thus, the http thread is not blocked by driving the service stop/ restart, etc. and returns almost immediately.

It is a nice solution and cleaner code.


The patch also simplifies the code and is probably safer then the previous behavior (just one thread is responsible for service management).


What do you think? May i send it to cvs?

Pending an answer on my comment above, here's mine +1 :)

--
Jan-Henrik Haukeland
Mobil +47 97141255




_______________________________________________
monit-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/monit-dev

Reply via email to