nsivabalan commented on code in PR #10345:
URL: https://github.com/apache/hudi/pull/10345#discussion_r1429207366


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metrics/Metrics.java:
##########
@@ -112,16 +114,25 @@ private List<MetricsReporter> 
addAdditionalMetricsExporters(HoodieWriteConfig me
     return reporterList;
   }
 
-  public synchronized void shutdown() {
-    try {
-      registerHoodieCommonMetrics();
-      reporters.forEach(MetricsReporter::report);
-      LOG.info("Stopping the metrics reporter...");
-      reporters.forEach(MetricsReporter::stop);
-    } catch (Exception e) {
-      LOG.warn("Error while closing reporter", e);
-    } finally {
-      initialized = false;
+  public void shutdown() {
+    shutdown(false);
+  }
+
+  private synchronized void shutdown(boolean fromShutdownHook) {
+    if (!fromShutdownHook) {
+      Runtime.getRuntime().removeShutdownHook(shutdownThread);
+    }

Review Comment:
   should we add a warn log if shutdown is called due to shutdown hook ? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to