summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client.c
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2014-04-07 10:57:45 +0530
committerAnand Avati <avati@redhat.com>2014-04-29 14:23:51 -0700
commitc61bc1f9e5874cb8380ec6398680fc71aea233b4 (patch)
treec02fee67ebcc7c43a6338d34c5700916e672c110 /xlators/protocol/client/src/client.c
parent91ab65f812ec3b674f53230eacbd0d71964d3d01 (diff)
glusterd: Ping timer implmentation
This patch refactors the existing client ping timer implementation, and makes use of the common code for implementing both client ping timer and the glusterd ping timer. A new gluster rpc program for ping is introduced. The ping timer is only started for peers that have this new program. The deafult glusterd ping timeout is 30 seconds. It is configurable by setting the option 'ping-timeout' in glusterd.vol . Also, this patch introduces changes in the glusterd-handshake path. The client programs for a peer are now set in the callback of dump_versions, for both the older handshake and the newer op-version handshake. This is the only place in the handshake process where we know what programs a peer supports. Change-Id: I035815ac13449ca47080ecc3253c0a9afbe9016a BUG: 1038261 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/5202 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/protocol/client/src/client.c')
-rw-r--r--xlators/protocol/client/src/client.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index 98fb10c34eb..7726c0b8445 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -29,7 +29,6 @@ extern rpc_clnt_prog_t clnt_dump_prog;
extern struct rpcclnt_cb_program gluster_cbk_prog;
int client_handshake (xlator_t *this, struct rpc_clnt *rpc);
-void client_start_ping (void *data);
int client_init_rpc (xlator_t *this);
int client_destroy_rpc (xlator_t *this);
int client_mark_fd_bad (xlator_t *this);
@@ -156,7 +155,6 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame,
struct iovec iov = {0, };
struct iobuf *iobuf = NULL;
int count = 0;
- char start_ping = 0;
struct iobref *new_iobref = NULL;
ssize_t xdr_size = 0;
struct rpc_req rpcreq = {0, };
@@ -235,19 +233,6 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame,
gf_log (this->name, GF_LOG_DEBUG, "rpc_clnt_submit failed");
}
- if (ret == 0) {
- pthread_mutex_lock (&conf->rpc->conn.lock);
- {
- if (!conf->rpc->conn.ping_started) {
- start_ping = 1;
- }
- }
- pthread_mutex_unlock (&conf->rpc->conn.lock);
- }
-
- if (start_ping)
- client_start_ping ((void *) this);
-
ret = 0;
if (new_iobref)