[HUDI-800] Fix Metrics getReporter().close() throws NPE. (#1529)
This commit is contained in:
@@ -52,9 +52,11 @@ public class Metrics {
|
|||||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
reporter.report();
|
reporter.report();
|
||||||
getReporter().close();
|
if (getReporter() != null) {
|
||||||
|
getReporter().close();
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
LOG.warn("Error while closing reporter", e);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user