Log exceptions from Tracer.finalize()
This commit is contained in:
parent
65add99a7b
commit
0e1dce868c
|
@ -261,8 +261,12 @@ public class DDTracer implements io.opentracing.Tracer, Closeable, datadog.trace
|
|||
|
||||
@Override
|
||||
public void finalize() {
|
||||
Runtime.getRuntime().removeShutdownHook(shutdownCallback);
|
||||
shutdownCallback.run();
|
||||
try {
|
||||
Runtime.getRuntime().removeShutdownHook(shutdownCallback);
|
||||
shutdownCallback.run();
|
||||
} catch (final Exception e) {
|
||||
log.error("Error while finalizing DDTracer.", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -138,8 +138,12 @@ public class Tracer implements Closeable {
|
|||
|
||||
@Override
|
||||
public void finalize() {
|
||||
Runtime.getRuntime().removeShutdownHook(shutdownCallback);
|
||||
shutdownCallback.run();
|
||||
try {
|
||||
Runtime.getRuntime().removeShutdownHook(shutdownCallback);
|
||||
shutdownCallback.run();
|
||||
} catch (final Exception e) {
|
||||
log.error("Error while finalizing Tracer.", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue