From 46a7adafe94b14778328d77a7f743fbce17341e3 Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Tue, 16 Aug 2011 13:17:38 +0530 Subject: glusterfsd: enable max fetch attempts Enables usage of 'volfile-max-fetch-attempts' option of glusterfsd. Also, adds an option to 'mount.glusterfs' for setting the max fetch attempts. For a server with multiple ips, each call to gf_resolve_ip6() returns a different ip. Since gf_resolve_ip6() is called for each fetch attempt, this change also enables rrdns support for gluster. Change-Id: I3edadbf0ff43ff414b30eb50dd9ca4a6fd6b1089 BUG: 2441 Reviewed-on: http://review.gluster.com/239 Reviewed-by: Amar Tumballi Tested-by: Gluster Build System --- glusterfsd/src/glusterfsd-mgmt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index cb7db7cea56..330b83fa36f 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -730,19 +730,25 @@ mgmt_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event, void *data) { xlator_t *this = NULL; + cmd_args_t *cmd_args = NULL; glusterfs_ctx_t *ctx = NULL; int ret = 0; this = mydata; ctx = this->ctx; - + cmd_args = &ctx->cmd_args; switch (event) { case RPC_CLNT_DISCONNECT: if (!ctx->active) { + cmd_args->max_connect_attempts--; gf_log ("glusterfsd-mgmt", GF_LOG_ERROR, "failed to connect with remote-host: %s", strerror (errno)); - cleanup_and_exit (1); + gf_log ("glusterfsd-mgmt", GF_LOG_INFO, + "%d connect attempts left", + cmd_args->max_connect_attempts); + if (0 >= cmd_args->max_connect_attempts) + cleanup_and_exit (1); } break; case RPC_CLNT_CONNECT: -- cgit