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