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

[Cluster-devel] cluster/ccs/daemon cluster_mgr.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL50
Changes by:	teigland sourceware org	2006-12-14 21:01:34

Modified files:
	ccs/daemon     : cluster_mgr.c 

Log message:
	Switch from CMAN_DISPATCH_ONE loop to CMAN_DISPATCH_ALL to resolve
	delayed cman shutdown callbacks.
	bz 219385

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/daemon/cluster_mgr.c.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.23&r2=1.23.4.1

--- cluster/ccs/daemon/cluster_mgr.c	2006/10/20 14:18:00	1.23
+++ cluster/ccs/daemon/cluster_mgr.c	2006/12/14 21:01:34	1.23.4.1
@@ -30,9 +30,6 @@
 #include "globals.h"
 #include "libcman.h"
 
-static int cman_flag;
-static int cman_reason;
-
 typedef struct member_list {
   int count;
   int pad;
@@ -331,11 +328,19 @@
 
 static void cman_callback(cman_handle_t handle, void *private, int reason, int arg)
 {
-  cman_flag = 1;
-  cman_reason = reason;
+  switch (reason) {
+    case CMAN_REASON_TRY_SHUTDOWN:
+      cman_replyto_shutdown(handle, 1);
+      break;
+
+    case CMAN_REASON_STATECHANGE:
+      quorate = cman_is_quorate(handle);
+      free_member_list(members);
+      members = get_member_list(handle);
+      break;
 
-  if (reason == CMAN_REASON_TRY_SHUTDOWN) {
-    cman_replyto_shutdown(handle, 1);
+    default:
+      break;
   }
 }
 
@@ -344,17 +349,12 @@
 {
   ENTER("handle_cluster_event");
 
-  if (cman_dispatch(handle, CMAN_DISPATCH_ONE) < 0) {
-    return -1;
+  int rv = 1;
+  while (rv > 0) {
+    rv = cman_dispatch(handle, CMAN_DISPATCH_ALL);
   }
-
-  if (cman_flag) {
-    cman_flag = 0;
-    if (cman_reason == CMAN_REASON_STATECHANGE) {
-      quorate = cman_is_quorate(handle);
-      free_member_list(members);
-      members = get_member_list(handle);
-    }
+  if (rv < 0) {
+    return -1;
   }
 
   EXIT("handle_cluster_event");


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