From 9fd44bd90ecb60760919bda85308132341f857f9 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Sun, 18 Mar 2012 13:07:30 +0530 Subject: protocol/server: Clear internal locks on disconnect If there is a disconnect observed on the client when the inode/entry unlock is issued, but the reconnection to server happens with in the grace-time period the inode/entry lk will live and the unlock will never come from that client. The internal locks should be cleared on disconnect. Change-Id: Ib45b1035cfe3b1de381ef3b331c930011e7403be BUG: 803209 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/2966 Reviewed-by: Anand Avati Tested-by: Gluster Build System --- xlators/protocol/server/src/server.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xlators/protocol/server/src/server.c') diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 33889fd9b15..3c3147a19d4 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -58,7 +58,8 @@ grace_time_handler (void *data) server_conn_ref (conn); server_connection_put (this, conn, &detached); if (detached)//reconnection did not happen :-( - server_connection_cleanup (this, conn); + server_connection_cleanup (this, conn, + INTERNAL_LOCKS | POSIX_LOCKS); server_conn_unref (conn); } out: @@ -170,7 +171,8 @@ server_submit_reply (call_frame_t *frame, rpcsvc_request_t *req, void *arg, if (ret == -1) { gf_log_callingfn ("", GF_LOG_ERROR, "Reply submission failed"); if (frame && conn) - server_connection_cleanup (frame->this, conn); + server_connection_cleanup (frame->this, conn, + INTERNAL_LOCKS | POSIX_LOCKS); goto ret; } @@ -644,6 +646,7 @@ server_rpc_notify (rpcsvc_t *rpc, void *xl, rpcsvc_event_t event, put_server_conn_state (this, xprt); gf_log (this->name, GF_LOG_INFO, "disconnecting connection" "from %s", xprt->peerinfo.identifier); + server_connection_cleanup (this, conn, INTERNAL_LOCKS); pthread_mutex_lock (&conf->mutex); { list_del (&xprt->list); -- cgit