Author: Rusty Russell <rusty@rustcorp.com.au>
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 15 Dec 2009 09:56:16 +0000 (20:56 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 15 Dec 2009 09:56:16 +0000 (20:56 +1100)
Date:   Tue Dec 15 15:53:30 2009 +1030

    eventscript: hack to avoid overloading valgrind

    Now we fork one child per script, when running under valgrind the
load
    gets quite high.  This is because valgrind does a lot of work after
exit,
    and we don't wait for the children to finish; we start the next one
when
    the child reports status via the pipe.

    This fix is ugly, but simple.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
server/eventscript.c

index 5bec0e0ab96b045ccb658c64544be1ad082a247d..59cb6a3006025a676d41d064e90994389ba3d298 100644 (file)
@@ -450,6 +450,9 @@ static void ctdb_event_script_handler(struct event_context *ev, struct fd_event
                state->cb_status = 0;
        }
 
+       /* valgrind gets overloaded if we run next script as it's still doing
+        * post-execution analysis, so kill finished child here. */
+       kill(state->child, SIGKILL);
        state->child = 0;
 
        /* Aborted or finished all scripts?  We're done. */