233933
From e205516ef874d617e4756856098bf10e17b0ea3d Mon Sep 17 00:00:00 2001
233933
From: Raghavendra G <rgowdapp@redhat.com>
233933
Date: Fri, 22 Mar 2019 10:40:45 +0530
233933
Subject: [PATCH 49/52] transport/socket: log shutdown msg occasionally
233933
233933
>Change-Id: If3fc0884e7e2f45de2d278b98693b7a473220a5f
233933
>Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
233933
>Fixes: bz#1691616
233933
233933
BUG: 1691620
233933
Change-Id: If3fc0884e7e2f45de2d278b98693b7a473220a5f
233933
Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/167088
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
---
233933
 rpc/rpc-transport/socket/src/socket.c | 4 ++--
233933
 rpc/rpc-transport/socket/src/socket.h | 1 +
233933
 2 files changed, 3 insertions(+), 2 deletions(-)
233933
233933
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
233933
index 121d46b..f6de1d3 100644
233933
--- a/rpc/rpc-transport/socket/src/socket.c
233933
+++ b/rpc/rpc-transport/socket/src/socket.c
233933
@@ -807,8 +807,8 @@ __socket_shutdown(rpc_transport_t *this)
233933
         gf_log(this->name, GF_LOG_DEBUG, "shutdown() returned %d. %s", ret,
233933
                strerror(errno));
233933
     } else {
233933
-        gf_log(this->name, GF_LOG_INFO, "intentional socket shutdown(%d)",
233933
-               priv->sock);
233933
+        GF_LOG_OCCASIONALLY(priv->shutdown_log_ctr, this->name, GF_LOG_INFO,
233933
+                            "intentional socket shutdown(%d)", priv->sock);
233933
     }
233933
 
233933
     return ret;
233933
diff --git a/rpc/rpc-transport/socket/src/socket.h b/rpc/rpc-transport/socket/src/socket.h
233933
index 32339d3..e1ccae2 100644
233933
--- a/rpc/rpc-transport/socket/src/socket.h
233933
+++ b/rpc/rpc-transport/socket/src/socket.h
233933
@@ -219,6 +219,7 @@ typedef struct {
233933
     int keepalivecnt;
233933
     int timeout;
233933
     int log_ctr;
233933
+    int shutdown_log_ctr;
233933
     /* ssl_error_required is used only during the SSL connection setup
233933
      * phase.
233933
      * It holds the error code returned by SSL_get_error() and is used to
233933
-- 
233933
1.8.3.1
233933