summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib/src/rpc-clnt.c
diff options
context:
space:
mode:
authorMilind Changire <mchangir@redhat.com>2017-08-23 10:10:13 +0530
committerRaghavendra G <rgowdapp@redhat.com>2017-08-23 10:34:33 +0000
commit5b14c11d3cae38bc66006b02217ede485ae30dea (patch)
tree30cad1f06388c585bf327e7dece1c9417085ddd4 /rpc/rpc-lib/src/rpc-clnt.c
parent2c1ddc55d1de154e072710fee18652977c832fa9 (diff)
rpc: disable client on disconnection from rebalance
Problem: glusterd rpc code path attempts to reconnect to rebalance process via the reconnect timer even after the rebalance process disconnection Solution: Set the clnt->disabled flag to 1 to avoid reconnection and cause the clnt object to be unref'd Change-Id: I4e38eaef45d2fdea86d25e9dff9f1af0cd29cf66 BUG: 1484225 Signed-off-by: Milind Changire <mchangir@redhat.com> Reviewed-on: https://review.gluster.org/18093 Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'rpc/rpc-lib/src/rpc-clnt.c')
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index e34d2ca47ac..71afa4bda66 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -478,6 +478,10 @@ rpc_clnt_reconnect_cleanup (rpc_clnt_connection_t *conn)
{
if (conn->reconnect) {
+ /* setting disabled = 1 helps to stop rearming of the
+ * reconnection timer and unref the rpc_clnt_t object
+ */
+ clnt->disabled = 1;
ret = gf_timer_call_cancel (clnt->ctx, conn->reconnect);
if (!ret) {
reconnect_unref = _gf_true;