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