summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2015-08-03 13:28:09 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-08-05 00:24:56 -0700
commit3403370ebeaf16567b79022c6ac48b2e0cd50db5 (patch)
treed8bfe196e89c59eb317c6f016790095cc4a65cfa
parent9361e2bf05dc511bcc6b49a67b69dfa231a2cab3 (diff)
client, rpc: make ping-timeout configurable for glusterfs clients
Change-Id: Idd94adb0457aaffce7330f56f98cebafa2c4dae8 BUG: 1249499 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/11818 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c15
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.h1
-rw-r--r--xlators/protocol/client/src/client.c23
3 files changed, 30 insertions, 9 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index 48bd35ce084..7bc9010f0b9 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -1793,6 +1793,21 @@ out:
void
rpc_clnt_reconfig (struct rpc_clnt *rpc, struct rpc_clnt_config *config)
{
+ if (config->ping_timeout) {
+ if (config->ping_timeout != rpc->conn.ping_timeout)
+ gf_log (rpc->conn.name, GF_LOG_INFO,
+ "changing ping timeout to %d (from %d)",
+ config->ping_timeout,
+ rpc->conn.ping_timeout);
+
+ pthread_mutex_lock (&rpc->conn.lock);
+ {
+ rpc->conn.ping_timeout = config->ping_timeout;
+ }
+ pthread_mutex_unlock (&rpc->conn.lock);
+
+ }
+
if (config->rpc_timeout) {
if (config->rpc_timeout != rpc->conn.config.rpc_timeout)
gf_log (rpc->conn.name, GF_LOG_INFO,
diff --git a/rpc/rpc-lib/src/rpc-clnt.h b/rpc/rpc-lib/src/rpc-clnt.h
index faae4855a6c..ee46a9a9263 100644
--- a/rpc/rpc-lib/src/rpc-clnt.h
+++ b/rpc/rpc-lib/src/rpc-clnt.h
@@ -125,6 +125,7 @@ struct rpc_clnt_config {
int rpc_timeout;
int remote_port;
char * remote_host;
+ int ping_timeout;
};
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index ea0a9d873ab..fcf6e375af8 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -2369,21 +2369,22 @@ client_check_event_threads (xlator_t *this, clnt_conf_t *conf, int32_t old,
int
reconfigure (xlator_t *this, dict_t *options)
{
- clnt_conf_t *conf = NULL;
- int ret = -1;
- int subvol_ret = 0;
- char *old_remote_subvol = NULL;
- char *new_remote_subvol = NULL;
- char *old_remote_host = NULL;
- char *new_remote_host = NULL;
- int32_t new_nthread = 0;
+ clnt_conf_t *conf = NULL;
+ int ret = -1;
+ int subvol_ret = 0;
+ char *old_remote_subvol = NULL;
+ char *new_remote_subvol = NULL;
+ char *old_remote_host = NULL;
+ char *new_remote_host = NULL;
+ int32_t new_nthread = 0;
+ struct rpc_clnt_config rpc_config = {0,};
conf = this->private;
GF_OPTION_RECONF ("frame-timeout", conf->rpc_conf.rpc_timeout,
options, int32, out);
- GF_OPTION_RECONF ("ping-timeout", conf->opt.ping_timeout,
+ GF_OPTION_RECONF ("ping-timeout", rpc_config.ping_timeout,
options, int32, out);
GF_OPTION_RECONF ("event-threads", new_nthread, options,
@@ -2425,6 +2426,10 @@ reconfigure (xlator_t *this, dict_t *options)
}
}
+ /* Reconfiguring client xlator's @rpc with new frame-timeout
+ * and ping-timeout */
+ rpc_clnt_reconfig (conf->rpc, &rpc_config);
+
GF_OPTION_RECONF ("filter-O_DIRECT", conf->filter_o_direct,
options, bool, out);