[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-06-22 22:24:49

Modified files:
	group/daemon   : cpg.c 

Log message:
	retry cpg_join and cpg_leave if error is TRY_AGAIN

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

--- cluster/group/daemon/cpg.c	2006/06/22 18:39:26	1.27
+++ cluster/group/daemon/cpg.c	2006/06/22 22:24:48	1.28
@@ -454,7 +454,13 @@
 
 	log_group(g, "is cpg client %d name %s handle %llx", ci, name.value, h);
 
+ retry:
 	error = cpg_join(h, &name);
+	if (error == CPG_ERR_TRY_AGAIN) {
+		log_debug("cpg_join error retry");
+		sleep(1);
+		goto retry;
+	}
 	if (error != CPG_OK) {
 		log_group(g, "cpg_join error %d", error);
 		cpg_finalize(h);
@@ -474,11 +480,16 @@
 	sprintf(name.value, "%d_%s", g->level, g->name);
 	name.length = strlen(name.value) + 1;
 
+ retry:
 	error = cpg_leave(g->cpg_handle, &name);
+	if (error == CPG_ERR_TRY_AGAIN) {
+		log_debug("cpg_leave error retry");
+		sleep(1);
+		goto retry;
+	}
 	if (error != CPG_OK) {
 		log_group(g, "cpg_leave error %d", error);
-
-		/* FIXME: what do do here? */
+		return error;
 	}
 
 	log_group(g, "cpg_leave ok");


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