Log exceptions from Tracer.finalize()
MODIFY
dd-trace-ot/src/main/java/datadog/opentracing/DDTracer.java
dd-trace-ot/src/main/java/datadog/opentracing/DDTracer.java
@@ -261,8 +261,12 @@ public class DDTracer implements io.opentracing.Tracer, Closeable, datadog.trace
@Override
public void finalize() {
+ try {
Runtime.getRuntime().removeShutdownHook(shutdownCallback);
shutdownCallback.run();
+ } catch (final Exception e) {
+ log.error("Error while finalizing DDTracer.", e);
+ }
}
/**

MODIFY
dd-trace/src/main/java/datadog/trace/tracer/Tracer.java
dd-trace/src/main/java/datadog/trace/tracer/Tracer.java
@@ -138,8 +138,12 @@ public class Tracer implements Closeable {
@Override
public void finalize() {
+ try {
Runtime.getRuntime().removeShutdownHook(shutdownCallback);
shutdownCallback.run();
+ } catch (final Exception e) {
+ log.error("Error while finalizing Tracer.", e);
+ }
}
@Override

Log exceptions from Tracer.finalize()