summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2014-06-30 11:26:54 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-02-22 10:10:50 -0800
commit27c09b9357004e5fdb02fdf0c586f3402878db1f (patch)
tree1c68c4fdb4cfa6d0bf2c49e0a5fd38bb62783021
parent663d1a5eed5a8aef6cfad4710e16d21740bf0da8 (diff)
socket: reduce rate of readv failure logs due to disconnect
... by using GF_LOG_OCCASIONALLY Change-Id: I779ff32ead13c8bb446a57b5baccf068ae992df1 BUG: 1114847 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/8210 Tested-by: Atin Mukherjee <amukherj@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
-rw-r--r--rpc/rpc-transport/socket/src/socket.c11
-rw-r--r--rpc/rpc-transport/socket/src/socket.h1
2 files changed, 7 insertions, 5 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index eb3a2d32ba4..be264fb7ce8 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -576,11 +576,12 @@ __socket_rwv (rpc_transport_t *this, struct iovec *vector, int count,
if (__does_socket_rwv_error_need_logging (priv,
write)) {
- gf_log (this->name, GF_LOG_WARNING,
- "%s on %s failed (%s)",
- write ? "writev":"readv",
- this->peerinfo.identifier,
- strerror (errno));
+ GF_LOG_OCCASIONALLY(priv->log_ctr, this->name,
+ GF_LOG_WARNING,
+ "%s on %s failed (%s)",
+ write ? "writev":"readv",
+ this->peerinfo.identifier,
+ strerror (errno));
}
if (priv->use_ssl && priv->ssl_ssl) {
diff --git a/rpc/rpc-transport/socket/src/socket.h b/rpc/rpc-transport/socket/src/socket.h
index 4c39695e99d..8395fd2fa58 100644
--- a/rpc/rpc-transport/socket/src/socket.h
+++ b/rpc/rpc-transport/socket/src/socket.h
@@ -239,6 +239,7 @@ typedef struct {
ot_state_t ot_state;
uint32_t ot_gen;
gf_boolean_t is_server;
+ int log_ctr;
} socket_private_t;