summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2010-11-16 08:17:07 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-11-16 06:35:14 -0800
commitce9f328aa93892ea79057c41c70836eb49fae8b5 (patch)
treeb618aeb9d6d8503706c78353303089f27905fcff
parent8faf940c00e3722a2322ee70ba1e18d9b9bc8c9c (diff)
protocol/client: use the new rpc_clnt initialization methods
This way of initializing an rpc_clnt object by splitting into a passive rpc_clnt_new and a delayed rpc_clnt_start between which registration of callback programs and notify methods are performed provides a race-free way to avoid the missing of connect notifications Signed-off-by: Anand V. Avati <avati@amp.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2078 (Volume Migration is not working) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2078
-rw-r--r--xlators/protocol/client/src/client.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index 6a4012173..198ba082a 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -1607,7 +1607,6 @@ int
notify (xlator_t *this, int32_t event, void *data, ...)
{
clnt_conf_t *conf = NULL;
- void *trans = NULL;
conf = this->private;
if (!conf)
@@ -1616,20 +1615,11 @@ notify (xlator_t *this, int32_t event, void *data, ...)
switch (event) {
case GF_EVENT_PARENT_UP:
{
- if (conf->rpc)
- trans = conf->rpc->conn.trans;
-
- if (!trans) {
- gf_log (this->name, GF_LOG_DEBUG,
- "transport init failed");
- return 0;
- }
-
gf_log (this->name, GF_LOG_DEBUG,
"got GF_EVENT_PARENT_UP, attempting connect "
"on transport");
- rpc_clnt_reconnect (trans);
+ rpc_clnt_start (conf->rpc);
}
break;
@@ -1761,7 +1751,7 @@ client_init_rpc (xlator_t *this)
goto out;
}
- conf->rpc = rpc_clnt_init (&conf->rpc_conf, this->options, this->ctx,
+ conf->rpc = rpc_clnt_new (&conf->rpc_conf, this->options, this->ctx,
this->name);
if (!conf->rpc)
goto out;