Rev 264: fixed a problem with the number of timed events growing without bound with the new seqnum code in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Tue May 8 11:16:30 GMT 2007


------------------------------------------------------------
revno: 264
revision-id: tridge at samba.org-20070508111629-cgamk1fazmat0dog
parent: tridge at samba.org-20070506215638-67wvsh0zwt7bbllo
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Tue 2007-05-08 21:16:29 +1000
message:
  fixed a problem with the number of timed events growing without bound with the new seqnum code
modified:
  common/ctdb_ltdb.c             ctdb_ltdb.c-20061128065342-to93h6eejj5kon81-2
  include/ctdb_private.h         ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
=== modified file 'common/ctdb_ltdb.c'
--- a/common/ctdb_ltdb.c	2007-05-05 07:35:28 +0000
+++ b/common/ctdb_ltdb.c	2007-05-08 11:16:29 +0000
@@ -440,8 +440,9 @@
 	ctdb_db->seqnum = new_seqnum;
 
 	/* setup a new timer */
-	event_add_timed(ctdb->ev, ctdb_db, timeval_current_ofs(ctdb->seqnum_frequency, 0),
-			ctdb_ltdb_seqnum_check, ctdb_db);
+	ctdb_db->te = event_add_timed(ctdb->ev, ctdb_db, 
+				      timeval_current_ofs(ctdb->seqnum_frequency, 0),
+				      ctdb_ltdb_seqnum_check, ctdb_db);
 }
 
 /*
@@ -456,8 +457,11 @@
 		return -1;
 	}
 
-	event_add_timed(ctdb->ev, ctdb_db, timeval_current_ofs(ctdb->seqnum_frequency, 0),
-			ctdb_ltdb_seqnum_check, ctdb_db);
+	if (ctdb_db->te == NULL) {
+		ctdb_db->te = event_add_timed(ctdb->ev, ctdb_db, 
+					      timeval_current_ofs(ctdb->seqnum_frequency, 0),
+					      ctdb_ltdb_seqnum_check, ctdb_db);
+	}
 
 	tdb_enable_seqnum(ctdb_db->ltdb->tdb);
 	ctdb_db->seqnum = tdb_get_seqnum(ctdb_db->ltdb->tdb);

=== modified file 'include/ctdb_private.h'
--- a/include/ctdb_private.h	2007-05-06 19:02:48 +0000
+++ b/include/ctdb_private.h	2007-05-08 11:16:29 +0000
@@ -246,6 +246,7 @@
 	struct tdb_wrap *ltdb;
 	struct ctdb_registered_call *calls; /* list of registered calls */
 	uint32_t seqnum;
+	struct timed_event *te;
 };
 
 



More information about the samba-cvs mailing list