From 5b14c11d3cae38bc66006b02217ede485ae30dea Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Wed, 23 Aug 2017 10:10:13 +0530 Subject: 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 Reviewed-on: https://review.gluster.org/18093 Smoke: Gluster Build System Tested-by: Raghavendra G Reviewed-by: Raghavendra G CentOS-regression: Gluster Build System --- rpc/rpc-lib/src/rpc-clnt.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'rpc') 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; -- cgit