This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: master - cman: Return an error if 'cman_tool leave' isattempted during shutdown
- From: Christine Caulfield <chrissie at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Fri, 2 Jan 2009 12:53:53 +0000 (UTC)
- Subject: cluster: master - cman: Return an error if 'cman_tool leave' isattempted during shutdown
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=88bea81933b3dfbe0b9dfe53db6003d9f4a11f70
Commit: 88bea81933b3dfbe0b9dfe53db6003d9f4a11f70
Parent: 59855af76c7022af96b8f89e8d3057768942936b
Author: Christine Caulfield <ccaulfie@redhat.com>
AuthorDate: Fri Jan 2 12:52:26 2009 +0000
Committer: Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Fri Jan 2 12:52:26 2009 +0000
cman: Return an error if 'cman_tool leave' is attempted during shutdown
There were some occasions when 'cman_tool leave' simply returned success
even though shutdown had already started. This fixes those.
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
cman/daemon/commands.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index 94e835e..34af7de 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -1004,7 +1004,7 @@ static int do_cmd_try_shutdown(struct connection *con, char *cmdbuf)
int flags = *(int *)cmdbuf;
/* Are we already in shutdown ? */
- if (shutdown_con)
+ if (shutdown_con || quit_threads)
return -EALREADY;
shutdown_con = con;
@@ -1015,6 +1015,7 @@ static int do_cmd_try_shutdown(struct connection *con, char *cmdbuf)
/* If no-one is listening for events then we can just go down now */
if (shutdown_expected == 0) {
+ quit_threads = 1;
send_leave(CLUSTER_LEAVEFLAG_DOWN);
return 0;
}