cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/group/daemon cman.c
Date: 14 Dec 2006 19:54:16 -0000	[thread overview]
Message-ID: <20061214195416.19047.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2006-12-14 19:54:16

Modified files:
	group/daemon   : cman.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/group/daemon/cman.c.diff?cvsroot=cluster&r1=1.28&r2=1.29

--- cluster/group/daemon/cman.c	2006/12/01 20:26:01	1.28
+++ cluster/group/daemon/cman.c	2006/12/14 19:54:16	1.29
@@ -10,8 +10,6 @@
 static int		old_node_count;
 static cman_node_t	cman_nodes[MAX_NODES];
 static int		cman_node_count;
-static int		cman_cb;
-static int		cman_reason;
 static char		name_buf[CMAN_MAX_NODENAME_LEN+1];
 
 
@@ -106,26 +104,18 @@
 	}
 }
 
-static void process_cman_callback(void)
+static void cman_callback(cman_handle_t h, void *private, int reason, int arg)
 {
-	switch (cman_reason) {
+	switch (reason) {
+	case CMAN_REASON_TRY_SHUTDOWN:
+		cman_replyto_shutdown(ch, 1);
+		break;
 	case CMAN_REASON_STATECHANGE:
 		statechange();
 		break;
-	default:
-		break;
 	}
 }
 
-static void cman_callback(cman_handle_t h, void *private, int reason, int arg)
-{
-	cman_cb = 1;
-	cman_reason = reason;
-
-	if (reason == CMAN_REASON_TRY_SHUTDOWN)
-		cman_replyto_shutdown(ch, 1);
-}
-
 static void close_cman(int ci)
 {
 	log_debug("cluster is down, exiting");
@@ -135,19 +125,7 @@
 static void process_cman(int ci)
 {
 	int rv;
-
-	while (1) {
-		rv = cman_dispatch(ch, CMAN_DISPATCH_ONE);
-		if (rv < 0)
-			break;
-
-		if (cman_cb) {
-			cman_cb = 0;
-			process_cman_callback();
-		} else
-			break;
-	}
-
+	rv = cman_dispatch(ch, CMAN_DISPATCH_ALL);
 	if (rv == -1 && errno == EHOSTDOWN)
 		close_cman(ci);
 }



             reply	other threads:[~2006-12-14 19:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-14 19:54 teigland [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-08-22 13:58 [Cluster-devel] cluster/group/daemon cman.c teigland
2007-08-21 19:33 teigland
2006-12-14 19:55 teigland
2006-12-14 19:54 teigland
2006-06-30 21:00 teigland
2006-06-30 15:34 teigland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061214195416.19047.qmail@sourceware.org \
    --to=teigland@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).