kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boy...@apache.org
Subject [kafka] branch trunk updated: MINOR: add additional shutdown log info (#9124)
Date Wed, 05 Aug 2020 05:08:13 GMT
This is an automated email from the ASF dual-hosted git repository.

boyang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e9ebe39  MINOR: add additional shutdown log info (#9124)
e9ebe39 is described below

commit e9ebe39e7c693ef595c68cfe91ce4e3a68788e2c
Author: Boyang Chen <boyang@confluent.io>
AuthorDate: Tue Aug 4 22:07:16 2020 -0700

    MINOR: add additional shutdown log info (#9124)
    
    As title, additional logging added to detect the shutdown progress for Kafka server.
    
    Reviewers: Jason Gustafson <jason@confluent.io>
---
 clients/src/main/java/org/apache/kafka/common/metrics/Metrics.java   | 4 +++-
 .../src/main/java/org/apache/kafka/common/utils/AppInfoParser.java   | 2 ++
 core/src/main/scala/kafka/server/KafkaRequestHandler.scala           | 5 +++--
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/common/metrics/Metrics.java b/clients/src/main/java/org/apache/kafka/common/metrics/Metrics.java
index fcaa3b6..01cfbea 100644
--- a/clients/src/main/java/org/apache/kafka/common/metrics/Metrics.java
+++ b/clients/src/main/java/org/apache/kafka/common/metrics/Metrics.java
@@ -665,14 +665,16 @@ public class Metrics implements Closeable {
                 Thread.currentThread().interrupt();
             }
         }
+        log.info("Metrics scheduler closed");
 
         for (MetricsReporter reporter : reporters) {
             try {
+                log.info("Closing reporter {}", reporter.getClass().getName());
                 reporter.close();
             } catch (Exception e) {
                 log.error("Error when closing " + reporter.getClass().getName(), e);
             }
         }
+        log.info("Metrics reporters closed");
     }
-
 }
diff --git a/clients/src/main/java/org/apache/kafka/common/utils/AppInfoParser.java b/clients/src/main/java/org/apache/kafka/common/utils/AppInfoParser.java
index 3ceca99..19f98d1 100644
--- a/clients/src/main/java/org/apache/kafka/common/utils/AppInfoParser.java
+++ b/clients/src/main/java/org/apache/kafka/common/utils/AppInfoParser.java
@@ -79,6 +79,8 @@ public class AppInfoParser {
             unregisterMetrics(metrics);
         } catch (JMException e) {
             log.warn("Error unregistering AppInfo mbean", e);
+        } finally {
+            log.info("App info {} for {} unregistered", prefix, id);
         }
     }
 
diff --git a/core/src/main/scala/kafka/server/KafkaRequestHandler.scala b/core/src/main/scala/kafka/server/KafkaRequestHandler.scala
index dbf3484..3300577 100755
--- a/core/src/main/scala/kafka/server/KafkaRequestHandler.scala
+++ b/core/src/main/scala/kafka/server/KafkaRequestHandler.scala
@@ -282,7 +282,7 @@ object BrokerTopicStats {
   private val valueFactory = (k: String) => new BrokerTopicMetrics(Some(k))
 }
 
-class BrokerTopicStats {
+class BrokerTopicStats extends Logging {
   import BrokerTopicStats._
 
   private val stats = new Pool[String, BrokerTopicMetrics](Some(valueFactory))
@@ -359,6 +359,7 @@ class BrokerTopicStats {
   def close(): Unit = {
     allTopicsStats.close()
     stats.values.foreach(_.close())
-  }
 
+    info("Broker and topic stats closed")
+  }
 }


Mime
View raw message