summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-03-18 13:07:30 +0530
committerAnand Avati <avati@redhat.com>2012-03-18 01:09:43 -0700
commit9fd44bd90ecb60760919bda85308132341f857f9 (patch)
tree0ed134e638c906ca8ae66153a1f5f00ddde28c12 /xlators/protocol/server/src/server.c
parentf20d895a8ed2a3ee032bd0f85d5bfaf645575fd7 (diff)
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 <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/2966 Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/protocol/server/src/server.c')
-rw-r--r--xlators/protocol/server/src/server.c7
1 files changed, 5 insertions, 2 deletions
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);