1
0

[HUDI-800] Fix Metrics getReporter().close() throws NPE. (#1529)

This commit is contained in:
lw0090
2020-04-19 21:33:07 +08:00
committed by GitHub
parent 75523657a4
commit 09fd6f64c5

View File

@@ -52,9 +52,11 @@ public class Metrics {
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
try {
reporter.report();
getReporter().close();
if (getReporter() != null) {
getReporter().close();
}
} catch (Exception e) {
e.printStackTrace();
LOG.warn("Error while closing reporter", e);
}
}));
}