Blob Blame History Raw
From d2e29bb0b5c2c744ca8cb311fe2645c8360c8c8b Mon Sep 17 00:00:00 2001
From: Atin Mukherjee <amukherj@redhat.com>
Date: Fri, 9 Jun 2017 17:10:00 +0530
Subject: [PATCH 508/509] glusterd: log stale rpc disconnects occasionally

There might be situations where if a brick process is killed through
SIGKILL (not SIGTERM) when brick mux is enabled glusterd will continue to
receive disconnect events from the stale rpc which might flood the
glusterd log. Fix is to use GF_LOG_OCCASIONALLY.

>Reviewed-on: https://review.gluster.org/17499
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
>Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>

Change-Id: I95a10c8be2346614e0a3458f98d9f99aab34800a
BUG: 1459900
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/108915
---
 xlators/mgmt/glusterd/src/glusterd-handler.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 3c793d9..c97d87d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -5588,6 +5588,8 @@ out:
         return ret;
 }
 
+static int gd_stale_rpc_disconnect_log;
+
 int
 __glusterd_brick_rpc_notify (struct rpc_clnt *rpc, void *mydata,
                              rpc_clnt_event_t event, void *data)
@@ -5672,9 +5674,10 @@ __glusterd_brick_rpc_notify (struct rpc_clnt *rpc, void *mydata,
                          * any are still left it doesn't hurt to keep the extra
                          * check and avoid further damage.
                          */
-                        gf_log (this->name, GF_LOG_WARNING,
-                                "got disconnect from stale rpc on %s",
-                                brickinfo->path);
+                        GF_LOG_OCCASIONALLY (gd_stale_rpc_disconnect_log,
+                                             this->name, GF_LOG_WARNING,
+                                             "got disconnect from stale rpc on "
+                                             "%s", brickinfo->path);
                         break;
                 }
                 if (glusterd_is_brick_started (brickinfo)) {
-- 
1.8.3.1