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