[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/group/daemon cpg.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland sourceware org	2006-10-13 15:57:23

Modified files:
	group/daemon   : cpg.c 

Log message:
	If cpg_join or cpg_leave are stuck in a retry loop, put an error
	message in syslog after ten seconds.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/cpg.c.diff?cvsroot=cluster&r1=1.35&r2=1.36

--- cluster/group/daemon/cpg.c	2006/10/06 16:55:19	1.35
+++ cluster/group/daemon/cpg.c	2006/10/13 15:57:23	1.36
@@ -475,7 +475,7 @@
 	cpg_error_t error;
 	cpg_handle_t h;
 	struct cpg_name name;
-	int fd, ci;
+	int fd, ci, i = 0;
 
 	error = cpg_initialize(&h, &callbacks);
 	if (error != CPG_OK) {
@@ -502,6 +502,8 @@
 	if (error == CPG_ERR_TRY_AGAIN) {
 		log_debug("cpg_join error retry");
 		sleep(1);
+		if (!(++i % 10))
+			log_error(g, "cpg_join error retrying");
 		goto retry;
 	}
 	if (error != CPG_OK) {
@@ -518,6 +520,7 @@
 {
 	cpg_error_t error;
 	struct cpg_name name;
+	int i = 0;
 
 	memset(&name, 0, sizeof(name));
 	sprintf(name.value, "%d_%s", g->level, g->name);
@@ -528,6 +531,8 @@
 	if (error == CPG_ERR_TRY_AGAIN) {
 		log_debug("cpg_leave error retry");
 		sleep(1);
+		if (!(++i % 10))
+			log_error(g, "cpg_leave error retrying");
 		goto retry;
 	}
 	if (error != CPG_OK) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]