This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: master - groupd/fenced/dlm_controld/gfs_controld: don'tretry ccs_connect


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=bac45ac58da6a28bf2eae94289b9b393341b1135
Commit:        bac45ac58da6a28bf2eae94289b9b393341b1135
Parent:        04db6b88c4fcaa525e766aaebc2795d2d770359e
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Fri Nov 21 13:01:06 2008 -0600
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Fri Nov 21 13:05:23 2008 -0600

groupd/fenced/dlm_controld/gfs_controld: don't retry ccs_connect

These daemons had an infinite loop around ccs_connect() in setup_ccs().
This would cause the daemon to hang if corosync/cman crashed between
setup_cman() and setup_ccs().

ccs_connect shouldn't need to be retried anyway since cman and ccs are
now unified and we do the necessary waiting for cman (and therefore ccs)
to be ready in setup_cman().

Signed-off-by: David Teigland <teigland@redhat.com>
---
 fence/fenced/config.c       |   13 ++++++-------
 group/daemon/main.c         |   12 +++++-------
 group/dlm_controld/config.c |   12 +++++-------
 group/gfs_controld/config.c |   12 +++++-------
 4 files changed, 21 insertions(+), 28 deletions(-)

diff --git a/fence/fenced/config.c b/fence/fenced/config.c
index 42794b4..e40d653 100644
--- a/fence/fenced/config.c
+++ b/fence/fenced/config.c
@@ -28,16 +28,15 @@ char *cfgd_override_path = DEFAULT_OVERRIDE_PATH;
 
 int setup_ccs(void)
 {
-	int i = 0, cd;
+	int cd;
 
-	while ((cd = ccs_connect()) < 0) {
-		sleep(1);
-		if (++i > 9 && !(i % 10))
-			log_error("connect to ccs error %d, "
-				  "check cluster status", cd);
+	cd = ccs_connect();
+	if (cd < 0) {
+		log_error("ccs_connect error %d %d", cd, errno);
+		return -1;
 	}
-
 	ccs_handle = cd;
+
 	return 0;
 }
 
diff --git a/group/daemon/main.c b/group/daemon/main.c
index ce8e75b..5ac1c87 100644
--- a/group/daemon/main.c
+++ b/group/daemon/main.c
@@ -126,15 +126,13 @@ void read_ccs_int(char *path, int *config_val)
 
 int setup_ccs(void)
 {
-	int i = 0, cd;
+	int cd;
 
-	while ((cd = ccs_connect()) < 0) {
-		sleep(1);
-		if (++i > 9 && !(i % 10))
-			log_print("connect to ccs error %d, "
-				  "check cluster status", cd);
+	cd = ccs_connect();
+	if (cd < 0) {
+		log_print("ccs_connect error %d %d", cd, errno);
+		return -1;
 	}
-
 	ccs_handle = cd;
 
 	/* These config values are set from cluster.conf only if they haven't
diff --git a/group/dlm_controld/config.c b/group/dlm_controld/config.c
index 870e09f..af71f5f 100644
--- a/group/dlm_controld/config.c
+++ b/group/dlm_controld/config.c
@@ -225,18 +225,16 @@ static void read_ccs_protocol(char *path, int *config_val)
 
 int setup_ccs(void)
 {
-	int i = 0, cd;
+	int cd;
 
 	if (ccs_handle)
 		goto update;
 
-	while ((cd = ccs_connect()) < 0) {
-		sleep(1);
-		if (++i > 9 && !(i % 10))
-			log_error("connect to ccs error %d, "
-				  "check cluster status", cd);
+	cd = ccs_connect();
+	if (cd < 0) {
+		log_error("ccs_connect error %d %d", cd, errno);
+		return -1;
 	}
-
 	ccs_handle = cd;
 
 	/* These config values are set from cluster.conf only if they haven't
diff --git a/group/gfs_controld/config.c b/group/gfs_controld/config.c
index 9ba1f62..f9b438f 100644
--- a/group/gfs_controld/config.c
+++ b/group/gfs_controld/config.c
@@ -151,18 +151,16 @@ void read_ccs_nodir(struct mountgroup *mg, char *buf)
 
 int setup_ccs(void)
 {
-	int i = 0, cd;
+	int cd;
 
 	if (ccs_handle)
 		goto update;
 
-	while ((cd = ccs_connect()) < 0) {
-		sleep(1);
-		if (++i > 9 && !(i % 10))
-			log_error("connect to ccs error %d, "
-				  "check cluster status", cd);
+	cd = ccs_connect();
+	if (cd < 0) {
+		log_error("ccs_connect error %d %d", cd, errno);
+		return -1;
 	}
-
 	ccs_handle = cd;
 
 	/* These config values are set from cluster.conf only if they haven't


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]