From bca46fd46b1a1a28daeb9ea3f47cef9bbacecd6d Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 21 Feb 2012 15:02:39 +0530 Subject: rpc/clnt: handle PARENT_DOWN event appropriately Change-Id: I4644e944bad4d240d16de47786b9fa277333dba4 BUG: 767862 Signed-off-by: Raghavendra G Signed-off-by: Amar Tumballi Reviewed-on: http://review.gluster.com/2735 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/protocol/client/src/client.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'xlators/protocol/client/src/client.c') diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 8955e237de..acbc4829bb 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -2062,7 +2062,7 @@ out: int notify (xlator_t *this, int32_t event, void *data, ...) { - clnt_conf_t *conf = NULL; + clnt_conf_t *conf = NULL; conf = this->private; if (!conf) @@ -2076,8 +2076,22 @@ notify (xlator_t *this, int32_t event, void *data, ...) "on transport"); rpc_clnt_start (conf->rpc); + break; } - break; + + case GF_EVENT_PARENT_DOWN: + gf_log (this->name, GF_LOG_INFO, + "current graph is no longer active, destroying " + "rpc_client "); + + pthread_mutex_lock (&conf->lock); + { + conf->parent_down = 1; + } + pthread_mutex_unlock (&conf->lock); + + rpc_clnt_disable (conf->rpc); + break; default: gf_log (this->name, GF_LOG_DEBUG, -- cgit