From 801697cc08928660a8087d08122a3aed622f6790 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Fri, 9 Jun 2017 17:10:00 +0530 Subject: 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. Change-Id: I95a10c8be2346614e0a3458f98d9f99aab34800a BUG: 1460225 Signed-off-by: Atin Mukherjee Reviewed-on: https://review.gluster.org/17499 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Jeff Darcy --- xlators/mgmt/glusterd/src/glusterd-handler.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'xlators/mgmt/glusterd') diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 65e963fa367..b86580f9f0b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -5749,6 +5749,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) @@ -5833,9 +5835,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)) { -- cgit