diff options
author | Amar Tumballi <amar@gluster.com> | 2010-10-07 05:56:22 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-07 05:09:08 -0700 |
commit | 5979bc3b964adcb8a536dc354e4eca08acaff03e (patch) | |
tree | ca1a5ed41fbc95bd51be7791ae0445132b1593db /xlators | |
parent | 3c0a7fb86eef1eecada77a6f040f96e1fd9e0536 (diff) |
protocol/rpc/transport: bring in one more event for 'TRANSPORT-DESTROY'
needed because, a RPC disconnect doesn't mean that a RPC transport/listener
is dead. With this, the race in server protocol cleaning up the lock table /
fd table when some frames are in transit will be handled properly.
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1843 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1843
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/protocol/client/src/client.c | 2 | ||||
-rw-r--r-- | xlators/protocol/server/src/server-helpers.c | 6 | ||||
-rw-r--r-- | xlators/protocol/server/src/server.c | 7 |
3 files changed, 12 insertions, 3 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 50cb917aacc..1cc96532b04 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -2008,7 +2008,7 @@ fini (xlator_t *this) if (conf) { if (conf->rpc) - rpc_clnt_destroy (conf->rpc); + rpc_clnt_unref (conf->rpc); /* Saved Fds */ /* TODO: */ diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c index 5ea6f561908..69fb5f6a7d6 100644 --- a/xlators/protocol/server/src/server-helpers.c +++ b/xlators/protocol/server/src/server-helpers.c @@ -102,6 +102,10 @@ free_state (server_state_t *state) state->conn = NULL; } + if (state->xprt) { + rpc_transport_unref (state->xprt); + state->xprt = NULL; + } if (state->fd) { fd_unref (state->fd); state->fd = NULL; @@ -776,7 +780,7 @@ server_alloc_frame (rpcsvc_request_t *req) if (conn->bound_xl) state->itable = conn->bound_xl->itable; - state->xprt = req->trans; + state->xprt = rpc_transport_ref (req->trans); state->conn = conn; state->resolve.fd_no = -1; diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 2851f8cea86..4fcce6e99d2 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -424,11 +424,16 @@ server_rpc_notify (rpcsvc_t *rpc, void *xl, rpcsvc_event_t event, case RPCSVC_EVENT_DISCONNECT: conn = get_server_conn_state (this, xprt); if (conn) - server_connection_put (this, conn); + server_connection_cleanup (this, conn); list_del (&xprt->list); break; + case RPCSVC_EVENT_TRANSPORT_DESTROY: + conn = get_server_conn_state (this, xprt); + if (conn) + server_connection_put (this, conn); + break; default: break; } |