From 070145750006c87099f945b4990a4460d814c21f Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Mon, 3 Oct 2016 10:55:23 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/15605 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee --- rpc/rpc-transport/socket/src/socket.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'rpc/rpc-transport') diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index ba6c5931480..89817b663df 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -2407,7 +2407,7 @@ out: return ret; } - +static int poll_err_cnt; static void * socket_poller (void *ctx) { @@ -2543,8 +2543,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) { -- cgit