diff options
author | Rajesh Joseph <rjoseph@redhat.com> | 2016-12-13 15:28:42 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-12-21 20:49:19 -0800 |
commit | af6769675acbbfd780fa2ece8587502d6d579372 (patch) | |
tree | e464f44c08163b9ba84e3d91d1e9d71efd5c04dc /rpc/rpc-transport/rdma | |
parent | 8b42e1b5688f8600086ecc0e33ac4abf5e7c2772 (diff) |
socket: socket disconnect should wait for poller thread exit
When SSL is enabled or if "transport.socket.own-thread" option is set
then socket_poller is run as different thread. Currently during
disconnect or PARENT_DOWN scenario we don't wait for this thread
to terminate. PARENT_DOWN will disconnect the socket layer and
cleanup resources used by socket_poller.
Therefore before disconnect we should wait for poller thread to exit.
Change-Id: I71f984b47d260ffd979102f180a99a0bed29f0d6
BUG: 1404181
Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-on: http://review.gluster.org/16141
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'rpc/rpc-transport/rdma')
-rw-r--r-- | rpc/rpc-transport/rdma/src/rdma.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c index 551ac072079..d2f04bd6d0c 100644 --- a/rpc/rpc-transport/rdma/src/rdma.c +++ b/rpc/rpc-transport/rdma/src/rdma.c @@ -51,7 +51,7 @@ static int32_t gf_rdma_teardown (rpc_transport_t *this); static int32_t -gf_rdma_disconnect (rpc_transport_t *this); +gf_rdma_disconnect (rpc_transport_t *this, gf_boolean_t wait); static void gf_rdma_cm_handle_disconnect (rpc_transport_t *this); @@ -1209,7 +1209,7 @@ gf_rdma_cm_handle_connect_init (struct rdma_cm_event *event) } if (ret < 0) { - gf_rdma_disconnect (this); + gf_rdma_disconnect (this, _gf_false); } return ret; @@ -3014,7 +3014,7 @@ gf_rdma_submit_request (rpc_transport_t *this, rpc_transport_req_t *req) RDMA_MSG_WRITE_PEER_FAILED, "sending request to peer (%s) failed", this->peerinfo.identifier); - rpc_transport_disconnect (this); + rpc_transport_disconnect (this, _gf_false); } out: @@ -3051,7 +3051,7 @@ gf_rdma_submit_reply (rpc_transport_t *this, rpc_transport_reply_t *reply) RDMA_MSG_WRITE_PEER_FAILED, "sending request to peer (%s) failed", this->peerinfo.identifier); - rpc_transport_disconnect (this); + rpc_transport_disconnect (this, _gf_false); } out: @@ -4095,7 +4095,7 @@ gf_rdma_process_recv (gf_rdma_peer_t *peer, struct ibv_wc *wc) out: if (ret == -1) { - rpc_transport_disconnect (peer->trans); + rpc_transport_disconnect (peer->trans, _gf_false); } return; @@ -4216,7 +4216,8 @@ gf_rdma_recv_completion_proc (void *data) if (peer) { ibv_ack_cq_events (event_cq, num_wr); rpc_transport_unref (peer->trans); - rpc_transport_disconnect (peer->trans); + rpc_transport_disconnect (peer->trans, + _gf_false); } if (post) { @@ -4292,7 +4293,7 @@ gf_rdma_handle_failed_send_completion (gf_rdma_peer_t *peer, struct ibv_wc *wc) } if (peer) { - rpc_transport_disconnect (peer->trans); + rpc_transport_disconnect (peer->trans, _gf_false); } return; @@ -4343,7 +4344,7 @@ gf_rdma_handle_successful_send_completion (gf_rdma_peer_t *peer, ret = gf_rdma_pollin_notify (peer, post); if ((ret == -1) && (peer != NULL)) { - rpc_transport_disconnect (peer->trans); + rpc_transport_disconnect (peer->trans, _gf_false); } out: @@ -4657,7 +4658,7 @@ gf_rdma_init (rpc_transport_t *this) static int32_t -gf_rdma_disconnect (rpc_transport_t *this) +gf_rdma_disconnect (rpc_transport_t *this, gf_boolean_t wait) { gf_rdma_private_t *priv = NULL; int32_t ret = 0; |