[SCM] CTDB repository - branch master updated - ctdb-1.0.103-7-geda0521

Ronnie Sahlberg sahlberg at samba.org
Thu Nov 5 04:00:50 MST 2009


The branch, master has been updated
       via  eda052101728cf922ce892e3c53b4f37e7ceac42 (commit)
       via  b7dc1e0720991cc65353e07cf87608acea21ba27 (commit)
       via  1a3ecdee85b82bb3234a92ae6bcdeb92238eb7ee (commit)
      from  1cbf06a126621b3e932925cdad2ef9c009f93d4e (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit eda052101728cf922ce892e3c53b4f37e7ceac42
Author: Volker Lendecke <vlendec at samba.org>
Date:   Tue Nov 3 20:01:00 2009 +0100

    Fix a segfault in the eventscript timeout handler.
    
    The state was freed too early.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit b7dc1e0720991cc65353e07cf87608acea21ba27
Author: Michael Adam <obnox at samba.org>
Date:   Tue Nov 3 20:00:27 2009 +0100

    ctdb.sysconfig: add a comment section about CTDB_RUN_TIMEOUT_MONITOR
    
    Michael

commit 1a3ecdee85b82bb3234a92ae6bcdeb92238eb7ee
Author: Michael Adam <obnox at samba.org>
Date:   Tue Nov 3 20:00:07 2009 +0100

    Add a 99.timeout event script to trigger monitor timeouts.
    
    This just sleeps for twice the value of EventScriptTimeout
    in the monitor action. It is not run by default, but
    can be activated by setting CTDB_RUN_TIMEOUT_MONITOR
    in /etc/sysconfig/ctdb .
    
    Michael

-----------------------------------------------------------------------

Summary of changes:
 config/ctdb.sysconfig      |    7 ++++++-
 config/events.d/99.timeout |   24 ++++++++++++++++++++++++
 server/eventscript.c       |    2 +-
 3 files changed, 31 insertions(+), 2 deletions(-)
 create mode 100755 config/events.d/99.timeout


Changeset truncated at 500 lines:

diff --git a/config/ctdb.sysconfig b/config/ctdb.sysconfig
index 9be69c5..e6c7b4f 100644
--- a/config/ctdb.sysconfig
+++ b/config/ctdb.sysconfig
@@ -194,6 +194,12 @@ CTDB_DEBUGLEVEL=ERR
 # The default is not to use syslog.
 # CTDB_SYSLOG=no
 
+# Should the 99.timeout monitor event script be run?
+# This event script just sleeps long enough to trigger the
+# event script timeout. Might be useful for debugging.
+# The default is "no".
+# CTDB_RUN_TIMEOUT_MONITOR=no
+
 # set any default tuning options for ctdb
 # use CTDB_SET_XXXX=value where XXXX is the name of the tuning
 # variable
@@ -201,7 +207,6 @@ CTDB_DEBUGLEVEL=ERR
 #    CTDB_SET_TRAVERSETIMEOUT=60
 # you can get a list of variables using "ctdb listvars"
 
-
 # any other options you might want. Run ctdbd --help for a list
 # CTDB_OPTIONS=
 
diff --git a/config/events.d/99.timeout b/config/events.d/99.timeout
new file mode 100755
index 0000000..9ef24e6
--- /dev/null
+++ b/config/events.d/99.timeout
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# Event script to just sleep longer than the timeout
+# in the monitor action. The purpose is to trigger
+# the event timeout mechanism.
+
+. $CTDB_BASE/functions
+loadconfig ctdb
+
+[ "x$CTDB_RUN_TIMEOUT_MONITOR" = "xyes" ] || exit 0
+
+cmd="$1"
+shift
+
+case $cmd in
+	monitor)
+		TIMEOUT=$(ctdb listvars | grep EventScriptTimeout | awk	'{print $3}')
+		echo "sleeping for $((TIMEOUT * 2)) seconds..."
+		sleep $((TIMEOUT * 2))
+		;;
+esac
+
+exit 0
+
diff --git a/server/eventscript.c b/server/eventscript.c
index 9711eba..7ad66c6 100644
--- a/server/eventscript.c
+++ b/server/eventscript.c
@@ -689,7 +689,6 @@ static void ctdb_event_script_timeout(struct event_context *ev, struct timed_eve
 	options = talloc_strdup(ctdb, state->options);
 	CTDB_NO_MEMORY_VOID(ctdb, options);
 
-	talloc_free(state);
 	if (!strcmp(options, "monitor")) {
 		/* if it is a monitor event, we allow it to "hang" a few times
 		   before we declare it a failure and ban ourself (and make
@@ -752,6 +751,7 @@ static void ctdb_event_script_timeout(struct event_context *ev, struct timed_eve
 		ctdb->script_monitor_ctx = NULL;
 	}
 
+	talloc_free(state);
 	talloc_free(options);
 }
 


-- 
CTDB repository


More information about the samba-cvs mailing list