From e8f9aabb782d4e97b1c2a6df379128c3f3962401 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Tue, 20 Mar 2012 16:00:41 +0530 Subject: protocol/server: remove the transport from the list irrespective of lock-heal is on/off Upon getting disconnect, remove the transport from the list of transports that protocol server maintains irrespective of whether lock-heal is on or off, since upon reconnect a new transport would be created. Change-Id: I18a269a93487d6e2cb11c345b6dde813d089809c BUG: 803815 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.com/2980 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- xlators/protocol/server/src/server.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'xlators/protocol') diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index d22852404c7..9539b239df0 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -661,6 +661,16 @@ server_rpc_notify (rpcsvc_t *rpc, void *xl, rpcsvc_event_t event, break; } case RPCSVC_EVENT_DISCONNECT: + /* transport has to be removed from the list upon disconnect + * irrespective of whether lock self heal is off or on, since + * new transport will be created upon reconnect. + */ + pthread_mutex_lock (&conf->mutex); + { + list_del (&xprt->list); + } + pthread_mutex_unlock (&conf->mutex); + conn = get_server_conn_state (this, xprt); if (!conn) break; @@ -681,11 +691,6 @@ server_rpc_notify (rpcsvc_t *rpc, void *xl, rpcsvc_event_t event, } else { put_server_conn_state (this, xprt); server_connection_cleanup (this, conn, INTERNAL_LOCKS); - pthread_mutex_lock (&conf->mutex); - { - list_del (&xprt->list); - } - pthread_mutex_unlock (&conf->mutex); pthread_mutex_lock (&conn->lock); { @@ -693,7 +698,7 @@ server_rpc_notify (rpcsvc_t *rpc, void *xl, rpcsvc_event_t event, goto unlock; gf_log (this->name, GF_LOG_INFO, "starting a grace " - "timer for %s", xprt->name); + "timer for %s", conn->id); conn->timer = gf_timer_call_after (this->ctx, conf->grace_tv, -- cgit