diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2016-03-20 18:31:00 +0530 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-03-22 12:24:53 -0700 |
commit | 1081584d4c2d26e56fea623ecfadd305c6e3d3bc (patch) | |
tree | 9f6d06ae7e136e428a9f284a2db7a211ed4495d6 /xlators/mgmt/glusterd/src/glusterd-handler.c | |
parent | 056bce103c31be8416bd3ede93c7258c5b3f8554 (diff) |
glusterd/rpc : Discard duplicate Disconnect events
If a peer rpc disconnect event has been already processed, skip the furthers as
processing them are overheads and sometimes may lead to a crash like due to a
double free
Change-Id: Iec589ce85daf28fd5b267cb6fc82a4238e0e8adc
BUG: 1318546
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/13790
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 9007843be4a..d385c35b34b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -5184,6 +5184,12 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata, case RPC_CLNT_DISCONNECT: { + /* If DISCONNECT event is already processed, skip the further + * ones + */ + if (is_rpc_clnt_disconnected (&rpc->conn)) + break; + rpc_clnt_unset_connected (&rpc->conn); gf_msg (this->name, GF_LOG_INFO, 0, GD_MSG_PEER_DISCONNECTED, |