Skip to contentSkip to conversation

cluster/group/daemon app.c

Cluster-devel [email protected] 1 participant 1 message Sep 15, 2006

lore
Share & tools
lore
#0 lore raw

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

group/daemon/app.c +10 -11
@@ -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;