[SCM] CTDB repository - branch status-test updated - ctdb-1.0.104-20-g51f3dee

Ronnie Sahlberg sahlberg at samba.org
Mon Nov 23 22:15:41 MST 2009


The branch, status-test has been updated
       via  51f3deee99d7c7367d42a6cf73b2dfbddb861e68 (commit)
      from  66b22980b14601f29fe8cc64bd8f29883c7ca1c0 (commit)

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


- Log -----------------------------------------------------------------
commit 51f3deee99d7c7367d42a6cf73b2dfbddb861e68
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Nov 24 16:13:55 2009 +1100

    dont recycle the "other script context"
    
    make the script log a child of ctdb, not the monitor script context (which may be recycled)

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

Summary of changes:
 server/eventscript.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/server/eventscript.c b/server/eventscript.c
index 24e08f0..aa9805d 100644
--- a/server/eventscript.c
+++ b/server/eventscript.c
@@ -714,7 +714,7 @@ static void ctdb_event_script_timeout(struct event_context *ev, struct timed_eve
 			talloc_free(ctdb->last_monitor_status_ctx);
 			ctdb->last_monitor_status_ctx = NULL;
 		}
-		ctdb->last_monitor_status_ctx = talloc_steal(ctdb, ctdb->current_monitor_status_ctx);
+		ctdb->last_monitor_status_ctx = ctdb->current_monitor_status_ctx;
 		ctdb->current_monitor_status_ctx = NULL;
 	}
 
@@ -809,7 +809,7 @@ static int ctdb_event_script_callback_v(struct ctdb_context *ctdb,
 			ctdb->current_monitor_status_ctx = NULL;
 		}
 
-		ctdb->current_monitor_status_ctx = talloc(ctdb->monitor_event_script_ctx, struct ctdb_monitor_script_status_ctx);
+		ctdb->current_monitor_status_ctx = talloc(ctdb, struct ctdb_monitor_script_status_ctx);
 		ctdb->current_monitor_status_ctx->scripts = NULL;
 	} else {
 		/* any other script will first terminate any monitor event */
@@ -818,11 +818,9 @@ static int ctdb_event_script_callback_v(struct ctdb_context *ctdb,
 			ctdb->monitor_event_script_ctx = NULL;
 		}
 		/* and then use a context common for all non-monitor events */
-		if (ctdb->other_event_script_ctx != NULL) {
-			talloc_free(ctdb->other_event_script_ctx);
-			ctdb->other_event_script_ctx = NULL;
+		if (ctdb->other_event_script_ctx == NULL) {
+			ctdb->other_event_script_ctx = talloc_new(ctdb);
 		}
-		ctdb->other_event_script_ctx = talloc_new(ctdb);
 		mem_ctx = ctdb->other_event_script_ctx;
 	}
 


-- 
CTDB repository


More information about the samba-cvs mailing list