Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: heartbeat by alan from 
      ([email protected])
   2. Linux-HA CVS: include by alan from 
      ([email protected])
   3. Linux-HA CVS: crm by andrew from 
      ([email protected])


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

Message: 1
Date: Thu,  2 Feb 2006 07:58:24 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: heartbeat by alan from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : alan
Host    : 
Project : linux-ha
Module  : heartbeat

Dir     : linux-ha/heartbeat


Modified Files:
        heartbeat.c 


Log Message:
Moved our timeout functions to GSource.c.
Fixed a bug in the timing code in GSource.c (it almost never worked)
Added code to time the prepare check functions.
Added simpler ways to check for timeouts
Changed heartbeat to use these simpler ways, and checked more timeouts.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/heartbeat.c,v
retrieving revision 1.486
retrieving revision 1.487
diff -u -3 -r1.486 -r1.487
--- heartbeat.c 1 Feb 2006 14:59:10 -0000       1.486
+++ heartbeat.c 2 Feb 2006 14:58:23 -0000       1.487
@@ -2,7 +2,7 @@
  * TODO:
  * 1) Man page update
  */
-/* $Id: heartbeat.c,v 1.486 2006/02/01 14:59:10 alan Exp $ */
+/* $Id: heartbeat.c,v 1.487 2006/02/02 14:58:23 alan Exp $ */
 /*
  * heartbeat: Linux-HA heartbeat code
  *
@@ -1315,8 +1315,6 @@
        GMainLoop*              mainloop;
        long                    memstatsinterval;
        guint                   id;
-       GSource*                idg;
-
 
        init_xmit_hist (&msghist);
 
@@ -1335,9 +1333,10 @@
                /* Limit ourselves to 50% of the CPU */
                cl_cpu_limit_setpercent(50);
                /* Update our CPU limit periodically */
-               Gmain_timeout_add_full(G_PRIORITY_HIGH-1
+               id=Gmain_timeout_add_full(G_PRIORITY_HIGH-5
                ,       cl_cpu_limit_ms_interval()
                ,       hb_update_cpu_limit, NULL, NULL);
+               G_main_setall_id(id, "cpu limit", 50, 10);
        }
        cl_make_realtime(-1, hb_realtime_prio, 32, config->memreserve);
 
@@ -1366,7 +1365,8 @@
        }while (!allstarted);
        
        hb_add_deadtime(2000);
-       Gmain_timeout_add(5000, hb_pop_deadtime, NULL);
+       id = Gmain_timeout_add(5000, hb_pop_deadtime, NULL);
+       G_main_setall_id(id, "hb_pop_deadtime", 500, 100);
 
        set_local_status(UPSTATUS);     /* We're pretty sure we're up ;-) */
        if (ANYDEBUG) {
@@ -1424,36 +1424,25 @@
        /* Send local status at the "right time" */
        id=Gmain_timeout_add_full(PRI_SENDSTATUS, config->heartbeat_ms
        ,       hb_send_local_status, NULL, NULL);
-       idg=g_main_context_find_source_by_id(NULL, id);
-       if (idg) {
-               Gmain_timeout_setmaxdispatchdelay(idg, 50);
-               Gmain_timeout_setmaxdispatchtime(idg, 50);
-       }
+       G_main_setall_id(id, "send local status", 50, 50);
 
-       id=Gmain_timeout_add_full(PRI_SENDSTATUS
+       id=Gmain_timeout_add_full(PRI_AUDITCLIENT
        ,       config->initial_deadtime_ms
        ,       set_init_deadtime_passed_flag
        ,       NULL
        ,       NULL);
-       idg=g_main_context_find_source_by_id(NULL, id);
-       if (idg) {
-               Gmain_timeout_setmaxdispatchdelay(idg, 50);
-               Gmain_timeout_setmaxdispatchtime(idg, 50);
-       }
+       G_main_setall_id(id, "init deadtime passed", 500, 50);
 
        /* Dump out memory stats periodically... */
        memstatsinterval = (debug_level ? 10*60*1000 : ONEDAY*1000);
-       Gmain_timeout_add_full(PRI_DUMPSTATS, memstatsinterval
+       id=Gmain_timeout_add_full(PRI_DUMPSTATS, memstatsinterval
        ,       hb_dump_all_proc_stats, NULL, NULL);
+       G_main_setall_id(id, "memory stats", 5000, 100);
 
        /* Audit clients for liveness periodically */
        id=Gmain_timeout_add_full(PRI_AUDITCLIENT, 9*1000
        ,       api_audit_clients, NULL, NULL);
-       idg=g_main_context_find_source_by_id(NULL, id);
-       if (idg) {
-               Gmain_timeout_setmaxdispatchdelay(idg, 5000);
-               Gmain_timeout_setmaxdispatchtime(idg, 50);
-       }
+       G_main_setall_id(id, "client audit", 5000, 100);
 
        /* Reset timeout times to "now" */
        for (j=0; j < config->nodecount; ++j) {
@@ -1465,19 +1454,11 @@
        /* Check for pending signals */
        id=Gmain_timeout_add_full(PRI_SENDSTATUS, config->heartbeat_ms
        ,       Gmain_hb_signal_process_pending, NULL, NULL);
-       idg=g_main_context_find_source_by_id(NULL, id);
-       if (idg) {
-               Gmain_timeout_setmaxdispatchdelay(idg, 1000);
-               Gmain_timeout_setmaxdispatchtime(idg, 50);
-       }
+       G_main_setall_id(id, "check for signals", 500, 50);
        
        id=Gmain_timeout_add_full(PRI_FREEMSG, 500
        ,       Gmain_update_msgfree_count, NULL, NULL);
-       idg=g_main_context_find_source_by_id(NULL, id);
-       if (idg) {
-               Gmain_timeout_setmaxdispatchdelay(idg, 1000);
-               Gmain_timeout_setmaxdispatchtime(idg, 50);
-       }
+       G_main_setall_id(id, "update msgfree count", 500, 50);
        
        if (UseApphbd) {
                Gmain_timeout_add_full(PRI_DUMPSTATS
@@ -1929,7 +1910,8 @@
 gboolean
 hb_mcp_final_shutdown(gpointer p)
 {
-       static int shutdown_phase = 0;
+       static int      shutdown_phase = 0;
+       guint           id;
 
        if (ANYDEBUG) {
                cl_log(LOG_DEBUG, "hb_mcp_final_shutdown() phase %d"
@@ -1970,8 +1952,9 @@
                        /* Shouldn't *really* need this */
                        hb_kill_rsc_mgmt_children(SIGTERM);
                }
-               Gmain_timeout_add(1000, hb_mcp_final_shutdown /* phase 2 */
+               id=Gmain_timeout_add(1000, hb_mcp_final_shutdown /* phase 2 */
                ,       NULL);
+               G_main_setall_id(id, "shutdown phase 2", 500, 100);
                return FALSE;
 
        case 2: /* From 1-second delay above */
@@ -3793,7 +3776,6 @@
        const char* destnode = NULL;
        long i;
        int startindex = (long) data;
-       GSource *       gs;
        guint           id;
        
        
@@ -3845,12 +3827,7 @@
        send_cluster_msg(msg);
        
        id = Gmain_timeout_add(1000, send_reqnodes_msg, (gpointer)i);
-       gs = g_main_context_find_source_by_id(NULL, id);
-
-       if (gs) {
-               Gmain_timeout_setmaxdispatchdelay(gs, 100);
-               Gmain_timeout_setmaxdispatchtime(gs, 50);
-       }
+       G_main_setall_id(id, "send_reqnodes_msg", 500, 100);
        return FALSE;
 }
 
@@ -5144,19 +5121,11 @@
                                /* IS THIS RIGHT??? FIXME ?? */
                                if (DoManageResources) {
                                        guint id;
-                                       GSource * gs;
                                        send_local_status();
                                        (void)CauseShutdownRestart;
                                        id = Gmain_timeout_add(2000
                                        ,       CauseShutdownRestart,NULL);
-                                       gs = g_main_context_find_source_by_id
-                                       (       NULL, id);
-                                       if (gs) {
-                                               
Gmain_timeout_setmaxdispatchdelay
-                                               (gs,    1000);
-                                               Gmain_timeout_setmaxdispatchtime
-                                               (gs, 50);
-                                       }
+                                       G_main_setall_id(id, "shutdown 
restart", 1000, 50);
                                }
                                ishealedpartition=1;
                        }
@@ -6099,6 +6068,13 @@
 
 /*
  * $Log: heartbeat.c,v $
+ * Revision 1.487  2006/02/02 14:58:23  alan
+ * Moved our timeout functions to GSource.c.
+ * Fixed a bug in the timing code in GSource.c (it almost never worked)
+ * Added code to time the prepare check functions.
+ * Added simpler ways to check for timeouts
+ * Changed heartbeat to use these simpler ways, and checked more timeouts.
+ *
  * Revision 1.486  2006/02/01 14:59:10  alan
  * Added some code to allow memory pre-reserve for heartbeat a configuration 
problem.
  *




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

Message: 2
Date: Thu,  2 Feb 2006 08:12:27 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: include by alan from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : alan
Host    : 
Project : linux-ha
Module  : include

Dir     : linux-ha/include/clplumbing


Modified Files:
        GSource.h 


Log Message:
Added new function definitions I forgot to commit earlier.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/clplumbing/GSource.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- GSource.h   31 Jan 2006 19:59:50 -0000      1.15
+++ GSource.h   2 Feb 2006 15:12:27 -0000       1.16
@@ -1,4 +1,4 @@
-/* $Id: GSource.h,v 1.15 2006/01/31 19:59:50 alan Exp $ */
+/* $Id: GSource.h,v 1.16 2006/02/02 15:12:27 alan Exp $ */
 /*
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -30,6 +30,11 @@
 void G_main_setmaxdispatchtime(GSource* s, unsigned long dispatchms);
 void G_main_setdescription(GSource* s, const char * description);
 
+void G_main_setmaxdispatchdelay_id(guint id, unsigned long delayms);
+void G_main_setmaxdispatchtime_id(guint id, unsigned long dispatchms);
+void G_main_setdescription_id(guint id, const char * description);
+void G_main_setall_id(guint id, const char * description, unsigned long 
delayms, unsigned long dispatchms);
+
 
 /***********************************************************************
  *     Functions for interfacing input to the mainloop




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

Message: 3
Date: Thu,  2 Feb 2006 08:56:45 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : crm

Dir     : linux-ha/crm/tengine


Modified Files:
        callbacks.c 


Log Message:
Dont shadow the abort() function.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/tengine/callbacks.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- callbacks.c 11 Jan 2006 13:06:11 -0000      1.58
+++ callbacks.c 2 Feb 2006 15:56:44 -0000       1.59
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.58 2006/01/11 13:06:11 andrew Exp $ */
+/* $Id: callbacks.c,v 1.59 2006/02/02 15:56:44 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -233,47 +233,47 @@
        } else if(safe_str_eq(type, XML_TAG_CIB)) {
                crm_data_t *section_xml = NULL;
                const char *section = NULL;
-               gboolean abort = FALSE;
+               gboolean stop_now = FALSE;
 
                section = XML_CIB_TAG_NODES;
-               if(abort == FALSE) {
+               if(stop_now == FALSE) {
                        section_xml = get_object_root(section, update);
                        xml_child_iter(section_xml, child, 
-                                      abort = TRUE;
+                                      stop_now = TRUE;
                                       break;
                                );
                }
                section = XML_CIB_TAG_RESOURCES;
-               if(abort == FALSE) {
+               if(stop_now == FALSE) {
                        section_xml = get_object_root(section, update);
                        xml_child_iter(section_xml, child, 
-                                      abort = TRUE;
+                                      stop_now = TRUE;
                                       break;
                                );
                }
                section = XML_CIB_TAG_CONSTRAINTS;
-               if(abort == FALSE) {
+               if(stop_now == FALSE) {
                        section_xml = get_object_root(section, update);
                        xml_child_iter(section_xml, child, 
-                                      abort = TRUE;
+                                      stop_now = TRUE;
                                       break;
                                );
                }
                section = XML_CIB_TAG_CRMCONFIG;
-               if(abort == FALSE) {
+               if(stop_now == FALSE) {
                        section_xml = get_object_root(section, update);
                        xml_child_iter(section_xml, child, 
-                                      abort = TRUE;
+                                      stop_now = TRUE;
                                       break;
                                );
                }
-               if(abort) {
+               if(stop_now) {
                        send_complete("Non-status update", update,
                                      te_update, i_cancel);
                } 
 
                section = XML_CIB_TAG_STATUS;
-               if(abort == FALSE) {
+               if(stop_now == FALSE) {
                        section_xml = get_object_root(section, update);
                        if(extract_event(section_xml) == FALSE) {
                                send_complete("Unexpected global status update",




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

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 27, Issue 9
*******************************************

Reply via email to