From db365c30d07f5faae4197e37148f64e75b54a7ec Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Tue, 31 Mar 2009 10:56:10 -0700 Subject: 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 --- glusterfsd/src/fetch-spec.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'glusterfsd/src/fetch-spec.c') diff --git a/glusterfsd/src/fetch-spec.c b/glusterfsd/src/fetch-spec.c index f914a416dd4..3e9712d8db4 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); -- cgit