summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2014-10-30 10:35:57 +0530
committerRaghavendra G <rgowdapp@redhat.com>2014-11-18 02:38:33 -0800
commit4a3c36ba002eaf9e77c6d71180fcc7d0a415d69f (patch)
treedebaabc184d3fff271b300c495435a0632b03fee /rpc/rpc-transport
parentc566e914a1ae84b18e20c917474be3028cd1b5de (diff)
rdma:client process will hang if server is started to send
the request before completing connection establishment in rdma, client and server will interchange their available buffers during the handshake to post incoming messages. Initially the available buffer is set to one, for the first message during handshake,when first message is received, quota for the buffer will set to proper value. So before receiving the message if server started to send the message, then the reserverd buffer for handshake will be utilised, then the handshake will fail because of lack of buffers. So we should block sending messages by server before proper connection establishment. Change-Id: I68ef44998f5df805265d3f42a5df7c31cb57f136 BUG: 1158746 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9003 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'rpc/rpc-transport')
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c
index 1e0cce54b7a..a1c86228ae6 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -2696,13 +2696,34 @@ gf_rdma_submit_request (rpc_transport_t *this, rpc_transport_req_t *req)
int32_t ret = 0;
gf_rdma_ioq_t *entry = NULL;
rpc_transport_data_t data = {0, };
+ gf_rdma_private_t *priv = NULL;
+ gf_rdma_peer_t *peer = NULL;
if (req == NULL) {
goto out;
}
+ priv = this->private;
+ if (priv == NULL) {
+ ret = -1;
+ goto out;
+ }
+
+ peer = &priv->peer;
data.is_request = 1;
data.data.req = *req;
+/*
+ * when fist message is received on a transport, quota variable will
+ * initiaize and quota_set will set to one. In gluster code client
+ * process with respect to transport is the one who sends the first
+ * message. Before settng quota_set variable if a submit request is
+ * came on server, then the message should not send.
+ */
+
+ if (priv->entity == GF_RDMA_SERVER && peer->quota_set == 0) {
+ ret = 0;
+ goto out;
+ }
entry = gf_rdma_ioq_new (this, &data);
if (entry == NULL) {