summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-01-24 22:55:07 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-01-27 12:18:00 -0800
commit7691550a5bd281e9d21771b37066d44434e92934 (patch)
tree46116c398b5b84fff689bae823045d0f8547edf0 /xlators/mgmt/glusterd
parentefda1b98f5ef5449687cf9ded8d0b2c82d948885 (diff)
use rpc_clnt_{new,start} (), instead of rpc_clnt_init();
to prevent a race between getting a CONNECT/DISCONNECT event before registering a notify function Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2314 (notify function registration in CLI) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2314
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 42b0efcd539..9aca4bd4b55 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -2505,7 +2505,7 @@ glusterd_friend_rpc_create (struct rpc_clnt **rpc,
if (ret)
goto out;
- new_rpc = rpc_clnt_init (&rpc_cfg, options, this->ctx, this->name);
+ new_rpc = rpc_clnt_new (&rpc_cfg, options, this->ctx, this->name);
if (!new_rpc) {
gf_log ("glusterd", GF_LOG_ERROR,
@@ -2517,6 +2517,9 @@ glusterd_friend_rpc_create (struct rpc_clnt **rpc,
ret = rpc_clnt_register_notify (new_rpc, glusterd_rpc_notify,
peerctx);
*rpc = new_rpc;
+
+ rpc_clnt_start (new_rpc);
+
out:
if (ret) {
if (new_rpc) {