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

teigland at sourceware.org teigland at sourceware.org
Fri Sep 15 20:07:15 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2006-09-15 20:07:15

Modified files:
	group/daemon   : app.c 

Log message:
	positive return code from recover_current_event() should just indicate
	that the event should be processed again, and not added to the return
	value of process_app() which causes the whole thing to be called in
	a loop

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/app.c.diff?cvsroot=cluster&r1=1.44&r2=1.45

--- cluster/group/daemon/app.c	2006/09/14 20:56:55	1.44
+++ cluster/group/daemon/app.c	2006/09/15 20:07:15	1.45
@@ -1323,7 +1323,8 @@
 		dump_group(g);
 }
 
-/* handle a node failure while processing an event */
+/* handle a node failure while processing an event. returning > 0 means
+   we want process_current_event() to be called for the group */
 
 int recover_current_event(group_t *g)
 {
@@ -1443,17 +1444,13 @@
 		rv += ret;
 
 		ret = recover_current_event(g);
-		if (ret > 0) {
-			rv += ret;
-
-			/* it's important that we call process_current_event()
-			   when recover_current_event() returns 1 */
+		if (ret <= 0)
+			goto out;
 
-			ret = process_current_event(g);
-			if (ret < 0)
-				goto out;
-			rv += ret;
-		}
+		ret = process_current_event(g);
+		if (ret < 0)
+			goto out;
+		rv += ret;
 	} else {
 		/* We only take on a new non-recovery event if there are
 		   no recovery sets outstanding.  The new event may be
@@ -1481,6 +1478,8 @@
 	return rv;
 }
 
+/* process_apps() will be called again immediately if it returns > 0 */
+
 int process_apps(void)
 {
 	group_t *g, *safe;




More information about the Cluster-devel mailing list