diff options
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 11 | ||||
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.h | 1 |
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; |