summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/fetch-spec.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@zresearch.com>2009-03-31 10:56:10 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-01 13:20:06 +0530
commitdb365c30d07f5faae4197e37148f64e75b54a7ec (patch)
tree5ae79870edcebfabe588bdc91f71910d45f72fa8 /glusterfsd/src/fetch-spec.c
parentaa63a122433d51e89148af27dab98cf68846dab4 (diff)
Enable glusterfs client to exit after a configured number of failed connects \ while fetching volume specification file from server
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'glusterfsd/src/fetch-spec.c')
-rw-r--r--glusterfsd/src/fetch-spec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/glusterfsd/src/fetch-spec.c b/glusterfsd/src/fetch-spec.c
index f914a416d..3e9712d8d 100644
--- a/glusterfsd/src/fetch-spec.c
+++ b/glusterfsd/src/fetch-spec.c
@@ -71,6 +71,7 @@ fetch_notify (xlator_t *this_xl, int event, void *data, ...)
{
int ret = 0;
call_frame_t *frame = NULL;
+ static int failed_connects = 0;
switch (event)
{
@@ -85,6 +86,11 @@ fetch_notify (xlator_t *this_xl, int event, void *data, ...)
0);
break;
case GF_EVENT_CHILD_DOWN:
+ failed_connects++;
+ if (failed_connects
+ >= this_xl->ctx->cmd_args.max_connect_attempts) {
+ exit (1);
+ }
break;
default:
ret = default_notify (this_xl, event, data);