summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c10
-rwxr-xr-xxlators/mount/fuse/utils/mount.glusterfs.in8
2 files changed, 15 insertions, 3 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index cb7db7c..330b83f 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:
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
index 1b01e1e..ab11a97 100755
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
@@ -120,7 +120,9 @@ start_glusterfs ()
if [ -n "$backupvolfile_server" ]; then
cmd_line1=$(echo "$cmd_line --volfile-server=$backupvolfile_server");
fi
-
+ if [ -n "$volfile_max_fetch_attempts" ]; then
+ cmd_line=$(echo "$cmd_line --volfile-max-fetch-attempts=$volfile_max_fetch_attempts");
+ fi
cmd_line=$(echo "$cmd_line --volfile-server=$server_ip");
fi
else
@@ -206,7 +208,10 @@ main ()
volfile_check=$(echo "$options" | sed -n 's/.*volfile-check=\([^,]*\).*/\1/p');
+ volfile_max_fetch_attempts=$(echo "$options" | sed -n 's/.*fetch-attempts=\([^,]*\).*/\1/p');
+
server_port=$(echo "$options" | sed -n 's/.*server-port=\([^,]*\).*/\1/p');
+
backupvolfile_server=$(echo "$options" | sed -n 's/.*backupvolfile-server=\([^,]*\).*/\1/p');
log_server=$(echo "$options" | sed -n 's/.*log-server=\([^,]*\).*/\1/p');
@@ -233,6 +238,7 @@ main ()
-e 's/[,]*backupvolfile-server=[^,]*//' \
-e 's/[,]*server-port=[^,]*//' \
-e 's/[,]*volume-id=[^,]*//' \
+ -e 's/[,]*fetch-attempts=[^,]*//' \
-e 's/[,]*log-server=[^,]*//' \
-e 's/[,]*ro[^,]*//' \
-e 's/[,]*acl[^,]*//' \