diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2014-07-08 08:18:27 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-07-09 06:57:20 -0700 |
commit | b9f1d1a120b4469d51d2a96eecc7ce83516593ba (patch) | |
tree | e298705ca9ff57181728c0eca323ee67534218e7 /xlators/mgmt | |
parent | 82e0fb290db880323613a3791acd33f96d421363 (diff) |
rpc: Do not reset @ping_started to 0 in ping callback
This is to avoid indefinite recursion of the following kind, that could
lead to a stack overflow:
rpc_clnt_start_ping() -> rpc_clnt_ping() -> rpc_clnt_submit() ->
rpc_clnt_start_ping() -> rpc_clnt_ping() -> rpc_clnt_submit() ...
and so on,
since it is possible that before rpc_clnt_start_ping() is called a
second time by the thread executing this codepath, the response to
previous ping request could ALWAYS come by and cause epoll thread to
reset conn->ping_started to 0.
This patch also fixes the issue of excessive ping traffic, which was
due to the client sending one ping rpc for every fop in the worst case.
Also removed dead code in glusterd.
Change-Id: I7c5e6ae3b1c9d23407c0a12a319bdcb43ba7a359
BUG: 1116243
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8257
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index c358e9f6d05..dc923b1eeb4 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -235,12 +235,12 @@ glusterd_submit_request_unlocked (struct rpc_clnt *rpc, void *req, xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc) { + char new_iobref = 0; int ret = -1; - struct iobuf *iobuf = NULL; - int count = 0; - char new_iobref = 0, start_ping = 0; - struct iovec iov = {0, }; + int count = 0; ssize_t req_size = 0; + struct iobuf *iobuf = NULL; + struct iovec iov = {0, }; GF_ASSERT (rpc); GF_ASSERT (this); @@ -279,21 +279,6 @@ glusterd_submit_request_unlocked (struct rpc_clnt *rpc, void *req, ret = rpc_clnt_submit (rpc, prog, procnum, cbkfn, &iov, count, NULL, 0, iobref, frame, NULL, 0, NULL, 0, NULL); - - if (ret == 0) { - pthread_mutex_lock (&rpc->conn.lock); - { - if (!rpc->conn.ping_started) { - start_ping = 1; - } - } - pthread_mutex_unlock (&rpc->conn.lock); - } - - if (start_ping) - //client_start_ping ((void *) this); - - ret = 0; out: if (new_iobref) { iobref_unref (iobref); |