From 6f992bdb637612aff5fd30239c446e4b700f16e9 Mon Sep 17 00:00:00 2001
From: moagrawa <moagrawa@redhat.com>
Date: Thu, 13 Oct 2016 13:40:11 +0530
Subject: [PATCH 103/141] rpc/socket.c : Modify gf_log message in socket_poller code in case of error
Problem: In case of SSL after stopping the volume if client(mount point) is
still trying to write the data on socket then it will throw an EIO
error on that socket and given this log message is captured at every
attempt this would flood the log file.
Solution: To reduce the frequency of stored log message use GF_LOG_OCCASIONALLY
instead of gf_log.
> BUG: 1381115
> Change-Id: I66151d153c2cbfb017b3ebc4c52162278c0f537c
> Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
> Reviewed-on: http://review.gluster.org/15605
> 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: Atin Mukherjee <amukherj@redhat.com>
> (cherry picked from commit 070145750006c87099f945b4990a4460d814c21f)
BUG: 1336377
Change-Id: I41491620deee54b65e54a7797280d6969f5872d4
Signed-off-by: moagrawa <moagrawa@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/86998
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
rpc/rpc-transport/socket/src/socket.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index f13d9b7..700157e 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -2409,7 +2409,7 @@ out:
return ret;
}
-
+static int poll_err_cnt;
static void *
socket_poller (void *ctx)
{
@@ -2545,8 +2545,11 @@ socket_poller (void *ctx)
break;
}
if (ret < 0 && errno != ENODATA) {
- gf_log(this->name,GF_LOG_ERROR,
- "error in polling loop");
+ GF_LOG_OCCASIONALLY (poll_err_cnt, this->name,
+ GF_LOG_ERROR,
+ "socket_poller %s failed (%s)",
+ this->peerinfo.identifier,
+ strerror (errno));
break;
}
if (priv->ot_gen != gen) {
--
1.7.1