cluster: STABLE31 - Revert "cman: do not free shutdown connection till the last message is sent"

Fabio M. Di Nitto fabbione at fedoraproject.org
Mon Aug 15 08:48:41 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8e0caa36fa1a65016757d38f39838f58fca6b030
Commit:        8e0caa36fa1a65016757d38f39838f58fca6b030
Parent:        0d05c47540f783587edbcb6b1c227aed2caf9fde
Author:        Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate:    Mon Aug 15 10:48:12 2011 +0200
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Mon Aug 15 10:48:12 2011 +0200

Revert "cman: do not free shutdown connection till the last message is sent"

This reverts commit 0d05c47540f783587edbcb6b1c227aed2caf9fde.
---
 cman/daemon/cnxman-private.h |    2 +-
 cman/daemon/commands.c       |    1 -
 cman/daemon/daemon.c         |    7 -------
 3 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/cman/daemon/cnxman-private.h b/cman/daemon/cnxman-private.h
index c2fd4b5..002480d 100644
--- a/cman/daemon/cnxman-private.h
+++ b/cman/daemon/cnxman-private.h
@@ -107,7 +107,7 @@ struct connection
 	uint32_t   confchg;     /* Registered for confchg */
 	struct list write_msgs; /* Queued messages to go to data clients */
 	uint32_t    num_write_msgs; /* Count of messages */
-	uint32_t    shutdown_con;
+	struct connection *next;
 	struct list list;       /* when on the client_list */
 };
 
diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index 781e193..2948952 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -1060,7 +1060,6 @@ static int do_cmd_try_shutdown(struct connection *con, char *cmdbuf)
 	shutdown_yes = 0;
 	shutdown_no = 0;
 	shutdown_expected = num_listeners();
-	shutdown_con->shutdown_con = 1;
 
 	/* If no-one is listening for events then we can just go down now */
 	if (shutdown_expected == 0) {
diff --git a/cman/daemon/daemon.c b/cman/daemon/daemon.c
index 3da476b..92cfd47 100644
--- a/cman/daemon/daemon.c
+++ b/cman/daemon/daemon.c
@@ -112,12 +112,6 @@ static void remove_client(hdb_handle_t handle, struct connection *con)
 	struct queued_reply *qm;
 	int msgs=0;
 
-	if (con->shutdown_con) {
-		P_DAEMON("Delay removal of shutdown connection\n");
-		con->shutdown_con = 0;
-		return;
-	}
-
 	poll_dispatch_delete(handle, con->fd);
 	close(con->fd);
 	if (con->type == CON_CLIENT)
@@ -348,7 +342,6 @@ static int process_rendezvous(hdb_handle_t handle, int fd, int revent, void *dat
 		newcon->port = 0;
 		newcon->events = 0;
 		newcon->num_write_msgs = 0;
-		newcon->shutdown_con = 0;
 		list_init(&newcon->write_msgs);
 		fcntl(client_fd, F_SETFL, fcntl(client_fd, F_GETFL, 0) | O_NONBLOCK);
 


More information about the cluster-commits mailing list