diff options
author | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-08-03 13:28:09 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-08-12 22:05:57 -0700 |
commit | 6ac0fd5707c5ab8a45d4a2d888059eeb3ce843c7 (patch) | |
tree | 73cdb2ed1b381ad249a933b6ce2d7ebbeaade133 /rpc | |
parent | d636c0b1cdf7e8897abbd734b2651045fb9ed113 (diff) |
client, rpc: make ping-timeout configurable for glusterfs clients
Change-Id: Idd94adb0457aaffce7330f56f98cebafa2c4dae8
BUG: 1250810
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>
(cherry picked from commit 3403370ebeaf16567b79022c6ac48b2e0cd50db5)
Reviewed-on: http://review.gluster.org/11848
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 15 | ||||
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index 2878372df83..5fbe072033a 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -1802,6 +1802,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; }; |