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: lib by alan from ([email protected])
2. Linux-HA CVS: include by alan from
([email protected])
3. Linux-HA CVS: heartbeat by alan from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Tue, 31 Jan 2006 12:59:50 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by alan from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : alan
Host :
Project : linux-ha
Module : lib
Dir : linux-ha/lib/clplumbing
Modified Files:
GSource.c
Log Message:
Added code to be able to tell what source it is that is misbehaving and/or
getting the shaft.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/clplumbing/GSource.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- GSource.c 31 Jan 2006 15:23:38 -0000 1.57
+++ GSource.c 31 Jan 2006 19:59:50 -0000 1.58
@@ -1,4 +1,4 @@
-/* $Id: GSource.c,v 1.57 2006/01/31 15:23:38 alan Exp $ */
+/* $Id: GSource.c,v 1.58 2006/01/31 19:59:50 alan Exp $ */
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -49,22 +49,6 @@
# define _NSIG 2*NSIG
#endif
-struct GFDSource_s {
- GSource source;
- unsigned magno; /* MAG_GFDSOURCE */
- long maxdispatchms; /* Time limit for dispatch function */
- long maxdispatchdelayms; /* Max delay before processing */
- longclock_t detecttime; /* Time last input detected */
- void* udata;
- gboolean (*dispatch)(int fd, gpointer user_data);
- GPollFD gpfd;
- GDestroyNotify dnotify;
- guint gsourceid;
-};
-
-
-typedef gboolean (*GCHdispatch)(IPC_Channel* ch, gpointer user_data);
-
#define COMMON_STRUCTSTART
\
GSource source; /* Common glib struct - must be 1st */
\
unsigned magno; /* Magic number */ \
@@ -73,8 +57,19 @@
longclock_t detecttime; /* Time last input detected */ \
void* udata; /* User-defined data */ \
guint gsourceid; /* Source id of this source */ \
+const char * description; /* Description of this source */ \
GDestroyNotify dnotify
+
+struct GFDSource_s {
+ COMMON_STRUCTSTART;
+ gboolean (*dispatch)(int fd, gpointer user_data);
+ GPollFD gpfd;
+};
+
+
+typedef gboolean (*GCHdispatch)(IPC_Channel* ch, gpointer user_data);
+
struct GCHSource_s {
COMMON_STRUCTSTART;
IPC_Channel* ch;
@@ -114,15 +109,17 @@
#define OUTPUT_EVENTS (G_IO_OUT)
#define DEF_EVENTS (INPUT_EVENTS|ERR_EVENTS)
-#define WARN_DELAY(ms, input) cl_log(LOG_WARNING \
- , "%s: Dispatch function was delayed" \
- " %ld ms before being called (GSource: 0x%lx)" \
- , __FUNCTION__, ms, POINTER_TO_ULONG(input))
+#define WARN_DELAY(ms, input) cl_log(LOG_WARNING
\
+ , "%s: Dispatch function for %s was delayed" \
+ " %ld ms before being called (GSource: 0x%lx)" \
+ , __FUNCTION__, (input)->description, ms \
+ , POINTER_TO_ULONG(input))
#define WARN_TOOLONG(ms, input) cl_log(LOG_WARNING
\
- , "%s: Dispatch function took too long to execute" \
+ , "%s: Dispatch function for %s took too long to execute" \
": %ld ms (GSource: 0x%lx)" \
- , __FUNCTION__, ms, POINTER_TO_ULONG(input))
+ , __FUNCTION__, (input)->description, ms \
+ , POINTER_TO_ULONG(input))
#define CHECK_DISPATCH_DELAY(input) { \
unsigned long ms; \
@@ -215,6 +212,7 @@
g_source_set_can_recurse(source, can_recurse);
ret->gsourceid = g_source_attach(source, NULL);
+ ret->description = "file descriptor";
if (ret->gsourceid == 0) {
g_source_remove_poll(source, &ret->gpfd);
@@ -410,6 +408,7 @@
g_source_set_can_recurse(source, can_recurse);
chp->gsourceid = g_source_attach(source, NULL);
+ chp->description = "IPC channel";
if (chp->gsourceid == 0) {
@@ -678,6 +677,7 @@
g_source_set_can_recurse(source, can_recurse);
wcp->gsourceid = g_source_attach(source, NULL);
+ wcp->description = "IPC wait for connection";
if (wcp->gsourceid == 0) {
g_source_remove_poll(source, &wcp->gpfd);
@@ -863,6 +863,7 @@
}
if(!failed) {
sig_src->gsourceid = g_source_attach(source, NULL);
+ sig_src->description = "signal";
if (sig_src->gsourceid < 1) {
cl_log(LOG_ERR
, "%s: Could not attach source for signal %d (%d)"
@@ -1098,6 +1099,7 @@
G_main_setmaxdispatchdelay((GSource*) src, 100);
G_main_setmaxdispatchtime((GSource*) src, 10);
+ G_main_setdescription((GSource*)src, "SIGCHLD");
return;
}
@@ -1155,6 +1157,7 @@
if(!failed) {
trig_src->gsourceid = g_source_attach(source, NULL);
+ trig_src->description = "trigger";
if (trig_src->gsourceid < 1) {
cl_log(LOG_ERR, "G_main_add_TriggerHandler: Could not
attach new source (%d)",
trig_src->gsourceid);
@@ -1300,3 +1303,14 @@
}
fdp->maxdispatchms = dispatchms;
}
+void
+G_main_setdescription(GSource* s, const char * description)
+{
+ GFDSource* fdp = (GFDSource*)s;
+ if (!IS_ONEOFOURS(fdp)) {
+ cl_log(LOG_ERR
+ , "Attempt to set max dispatch time on wrong object");
+ return;
+ }
+ fdp->description = description;
+}
------------------------------
Message: 2
Date: Tue, 31 Jan 2006 12:59:50 -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 code to be able to tell what source it is that is misbehaving and/or
getting the shaft.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/clplumbing/GSource.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- GSource.h 30 Jan 2006 18:41:59 -0000 1.14
+++ GSource.h 31 Jan 2006 19:59:50 -0000 1.15
@@ -1,4 +1,4 @@
-/* $Id: GSource.h,v 1.14 2006/01/30 18:41:59 alan Exp $ */
+/* $Id: GSource.h,v 1.15 2006/01/31 19:59:50 alan Exp $ */
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -28,6 +28,7 @@
void G_main_setmaxdispatchdelay(GSource* s, unsigned long delayms);
void G_main_setmaxdispatchtime(GSource* s, unsigned long dispatchms);
+void G_main_setdescription(GSource* s, const char * description);
/***********************************************************************
------------------------------
Message: 3
Date: Tue, 31 Jan 2006 12:59:51 -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:
hb_api.c heartbeat.c
Log Message:
Added code to be able to tell what source it is that is misbehaving and/or
getting the shaft.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/hb_api.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -3 -r1.148 -r1.149
--- hb_api.c 31 Jan 2006 04:30:37 -0000 1.148
+++ hb_api.c 31 Jan 2006 19:59:50 -0000 1.149
@@ -1,4 +1,4 @@
-/* $Id: hb_api.c,v 1.148 2006/01/31 04:30:37 alan Exp $ */
+/* $Id: hb_api.c,v 1.149 2006/01/31 19:59:50 alan Exp $ */
/*
* hb_api: Server-side heartbeat API code
*
@@ -1230,8 +1230,9 @@
, chan, FALSE
, APIclients_input_dispatch
, client, G_remove_client);
+ G_main_setdescription((GSource*)client->gsource, "API client");
G_main_setmaxdispatchdelay((GSource*)client->gsource, 500);
- G_main_setmaxdispatchtime((GSource*)client->gsource, 10);
+ G_main_setmaxdispatchtime((GSource*)client->gsource, 100);
if (ANYDEBUG) {
cl_log(LOG_DEBUG
, "client->gsource = 0x%lx"
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/heartbeat.c,v
retrieving revision 1.482
retrieving revision 1.483
diff -u -3 -r1.482 -r1.483
--- heartbeat.c 31 Jan 2006 16:20:30 -0000 1.482
+++ heartbeat.c 31 Jan 2006 19:59:50 -0000 1.483
@@ -2,7 +2,7 @@
* TODO:
* 1) Man page update
*/
-/* $Id: heartbeat.c,v 1.482 2006/01/31 16:20:30 alan Exp $ */
+/* $Id: heartbeat.c,v 1.483 2006/01/31 19:59:50 alan Exp $ */
/*
* heartbeat: Linux-HA heartbeat code
*
@@ -722,7 +722,8 @@
, fifochildipc[P_READFD]
, FALSE, FIFO_child_msg_dispatch, NULL, NULL);
G_main_setmaxdispatchdelay((GSource*)FifoChildSource, 2000);
- G_main_setmaxdispatchtime((GSource*)FifoChildSource, 10);
+ G_main_setmaxdispatchtime((GSource*)FifoChildSource, 50);
+ G_main_setdescription((GSource*)FifoChildSource, "FIFO");
return HA_OK;
}
@@ -1401,7 +1402,8 @@
, sysmedia[j]->wchan[P_WRITEFD], FALSE
, NULL, sysmedia+j, NULL);
G_main_setmaxdispatchdelay((GSource*)s, 50);
- G_main_setmaxdispatchtime((GSource*)s, 10);
+ G_main_setmaxdispatchtime((GSource*)s, 50);
+ G_main_setdescription((GSource*)s, "write child");
/* Connect up the read child IPC channel... */
@@ -1409,7 +1411,8 @@
, sysmedia[j]->rchan[P_WRITEFD], FALSE
, read_child_dispatch, sysmedia+j, NULL);
G_main_setmaxdispatchdelay((GSource*)s, 50);
- G_main_setmaxdispatchtime((GSource*)s, 10);
+ G_main_setmaxdispatchtime((GSource*)s, 50);
+ G_main_setdescription((GSource*)s, "read child");
}
@@ -1771,7 +1774,8 @@
regsource = G_main_add_IPC_WaitConnection(PRI_APIREGISTER, regwchan
, NULL, FALSE, APIregistration_dispatch, NULL, NULL);
G_main_setmaxdispatchdelay((GSource*)regsource, 500);
- G_main_setmaxdispatchtime((GSource*)regsource, 10);
+ G_main_setmaxdispatchtime((GSource*)regsource, 20);
+ G_main_setdescription((GSource*)regsource, "client registration");
if (regsource == NULL) {
@@ -3845,7 +3849,7 @@
if (gs) {
Gmain_timeout_setmaxdispatchdelay(gs, 100);
- Gmain_timeout_setmaxdispatchtime(gs, 10);
+ Gmain_timeout_setmaxdispatchtime(gs, 50);
}
return FALSE;
}
@@ -6095,6 +6099,9 @@
/*
* $Log: heartbeat.c,v $
+ * Revision 1.483 2006/01/31 19:59:50 alan
+ * Added code to be able to tell what source it is that is misbehaving and/or
getting the shaft.
+ *
* Revision 1.482 2006/01/31 16:20:30 alan
* Fixed some wrong calls for measuring dispatch time / latency
*
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 26, Issue 70
********************************************