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 --- xlators/protocol/client/src/client-protocol.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xlators/protocol') diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c index e7fda9f0e..55afa11e1 100644 --- a/xlators/protocol/client/src/client-protocol.c +++ b/xlators/protocol/client/src/client-protocol.c @@ -6228,6 +6228,7 @@ client_protocol_reconnect (void *trans_ptr) transport_t *trans = NULL; client_connection_t *conn = NULL; struct timeval tv = {0, 0}; + int32_t ret = 0; trans = trans_ptr; conn = trans->xl_private; @@ -6243,7 +6244,7 @@ client_protocol_reconnect (void *trans_ptr) gf_log (trans->xl->name, GF_LOG_DEBUG, "attempting reconnect"); - transport_connect (trans); + ret = transport_connect (trans); conn->reconnect = gf_timer_call_after (trans->xl->ctx, tv, @@ -6255,6 +6256,10 @@ client_protocol_reconnect (void *trans_ptr) } } pthread_mutex_unlock (&conn->lock); + + if (ret == -1) { + default_notify (trans->xl, GF_EVENT_CHILD_DOWN, NULL); + } } int -- cgit