summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2012-03-20 16:00:41 +0530
committerVijay Bellur <vijay@gluster.com>2012-03-20 07:49:01 -0700
commite8f9aabb782d4e97b1c2a6df379128c3f3962401 (patch)
tree2cf4f2f9306b6d58d767ee01fcb8c29cb8e2821a /xlators/protocol
parenta2291931d550cbbc19983bccb93dbf31a9993db4 (diff)
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 <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.com/2980 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/server/src/server.c17
1 files changed, 11 insertions, 6 deletions
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,