diff options
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index a53ac4da95b..15b8ff3309a 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -959,8 +959,6 @@ rpc_clnt_connection_init (struct rpc_clnt *clnt, glusterfs_ctx_t *ctx, goto out; } - rpc_clnt_reconnect (conn->trans); - ret = 0; out: @@ -974,6 +972,7 @@ rpc_clnt_init (struct rpc_clnt_config *config, dict_t *options, { int ret = -1; struct rpc_clnt *rpc = NULL; + struct rpc_clnt_connection *conn = NULL; rpc = GF_CALLOC (1, sizeof (*rpc), gf_common_mt_rpcclnt_t); if (!rpc) { @@ -1015,6 +1014,9 @@ rpc_clnt_init (struct rpc_clnt_config *config, dict_t *options, goto out; } + conn = &rpc->conn; + rpc_clnt_reconnect (conn->trans); + rpc = rpc_clnt_ref (rpc); INIT_LIST_HEAD (&rpc->programs); |