You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2020/04/19 12:55:22 UTC

[GitHub] [incubator-hudi] lw309637554 commented on a change in pull request #1529: [HUDI-800] fix Metrics getReporter().close() throws NPE when MetricsR…

lw309637554 commented on a change in pull request #1529: [HUDI-800] fix Metrics getReporter().close() throws NPE when MetricsR…
URL: https://github.com/apache/incubator-hudi/pull/1529#discussion_r410898303
 
 

 ##########
 File path: hudi-client/src/main/java/org/apache/hudi/metrics/Metrics.java
 ##########
 @@ -52,9 +52,11 @@ private Metrics(HoodieWriteConfig metricConfig) {
     Runtime.getRuntime().addShutdownHook(new Thread(() -> {
       try {
         reporter.report();
-        getReporter().close();
+        if (getReporter() != null) {
+          getReporter().close();
+        }
       } catch (Exception e) {
-        e.printStackTrace();
+        LOG.error("Error while closing reporter", e);
 
 Review comment:
   got it

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services