diff options
| author | Amar Tumballi <amarts@redhat.com> | 2012-02-21 15:02:39 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vijay@gluster.com> | 2012-02-21 01:42:42 -0800 | 
| commit | bca46fd46b1a1a28daeb9ea3f47cef9bbacecd6d (patch) | |
| tree | 161737d7de86c7310c5cba84900b64867005e740 /xlators/protocol/client/src/client.c | |
| parent | 7197111677619da96c80572a09331d6e28c1015b (diff) | |
rpc/clnt: handle PARENT_DOWN event appropriately
Change-Id: I4644e944bad4d240d16de47786b9fa277333dba4
BUG: 767862
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Reviewed-on: http://review.gluster.com/2735
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/protocol/client/src/client.c')
| -rw-r--r-- | xlators/protocol/client/src/client.c | 18 | 
1 files changed, 16 insertions, 2 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 8955e237dee..acbc4829bb4 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,  | 
