|
|
887953 |
From 04e697b79edd55680a319e6fdb5983a1e5686db9 Mon Sep 17 00:00:00 2001
|
|
|
887953 |
From: Atin Mukherjee <amukherj@redhat.com>
|
|
|
887953 |
Date: Wed, 3 Oct 2018 16:34:54 +0530
|
|
|
887953 |
Subject: [PATCH 416/444] glusterd: ignore RPC events when glusterd is shutting
|
|
|
887953 |
down
|
|
|
887953 |
|
|
|
887953 |
When glusterd receives a SIGTERM while it receives RPC
|
|
|
887953 |
connect/disconnect/destroy events, the thread might lead to a crash
|
|
|
887953 |
while accessing rcu_read_lock () as the clean up thread might have
|
|
|
887953 |
already freed up the resources. This is more observable when glusterd
|
|
|
887953 |
comes up with upgrade mode = on during upgrade process.
|
|
|
887953 |
|
|
|
887953 |
The solution is to ignore these events if glusterd is already in the
|
|
|
887953 |
middle of cleanup_and_exit ().
|
|
|
887953 |
|
|
|
887953 |
> upstream patch : https://review.gluster.org/#/c/glusterfs/+/21330/
|
|
|
887953 |
|
|
|
887953 |
>Fixes: bz#1635593
|
|
|
887953 |
>Change-Id: I12831d31c2f689d4deb038b83b9421bd5cce26d9
|
|
|
887953 |
>Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
887953 |
|
|
|
887953 |
Change-Id: I12831d31c2f689d4deb038b83b9421bd5cce26d9
|
|
|
887953 |
BUG: 1635071
|
|
|
887953 |
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
887953 |
Reviewed-on: https://code.engineering.redhat.com/gerrit/154848
|
|
|
887953 |
Reviewed-by: Sanju Rakonde <srakonde@redhat.com>
|
|
|
887953 |
Tested-by: Sanju Rakonde <srakonde@redhat.com>
|
|
|
887953 |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
887953 |
---
|
|
|
887953 |
xlators/mgmt/glusterd/src/glusterd-handler.c | 10 +++++++++-
|
|
|
887953 |
1 file changed, 9 insertions(+), 1 deletion(-)
|
|
|
887953 |
|
|
|
887953 |
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
|
|
|
887953 |
index 861ff17..bf37e70 100644
|
|
|
887953 |
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
|
|
|
887953 |
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
|
|
|
887953 |
@@ -6340,6 +6340,7 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
|
|
|
887953 |
glusterd_peerctx_t *peerctx = NULL;
|
|
|
887953 |
gf_boolean_t quorum_action = _gf_false;
|
|
|
887953 |
glusterd_volinfo_t *volinfo = NULL;
|
|
|
887953 |
+ glusterfs_ctx_t *ctx = NULL;
|
|
|
887953 |
uuid_t uuid;
|
|
|
887953 |
|
|
|
887953 |
peerctx = mydata;
|
|
|
887953 |
@@ -6355,7 +6356,14 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
|
|
|
887953 |
GF_FREE (peerctx);
|
|
|
887953 |
return 0;
|
|
|
887953 |
}
|
|
|
887953 |
-
|
|
|
887953 |
+ ctx = this->ctx;
|
|
|
887953 |
+ GF_VALIDATE_OR_GOTO (this->name, ctx, out);
|
|
|
887953 |
+ if (ctx->cleanup_started) {
|
|
|
887953 |
+ gf_log (this->name, GF_LOG_INFO, "glusterd already received a "
|
|
|
887953 |
+ "SIGTERM, dropping the event %d for peer %s", event,
|
|
|
887953 |
+ peerctx->peername);
|
|
|
887953 |
+ return 0;
|
|
|
887953 |
+ }
|
|
|
887953 |
rcu_read_lock ();
|
|
|
887953 |
|
|
|
887953 |
peerinfo = glusterd_peerinfo_find_by_generation (peerctx->peerinfo_gen);
|
|
|
887953 |
--
|
|
|
887953 |
1.8.3.1
|
|
|
887953 |
|