From 3403370ebeaf16567b79022c6ac48b2e0cd50db5 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Mon, 3 Aug 2015 13:28:09 +0530 Subject: client, rpc: make ping-timeout configurable for glusterfs clients Change-Id: Idd94adb0457aaffce7330f56f98cebafa2c4dae8 BUG: 1249499 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/11818 Tested-by: Gluster Build System Reviewed-by: Raghavendra G Tested-by: NetBSD Build System --- rpc/rpc-lib/src/rpc-clnt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'rpc/rpc-lib/src/rpc-clnt.c') 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, -- cgit