Ensure that PendingTrace.SPAN_CLEANER initialized with Tracer
Otherwise it might get initialized by a different classloader which would prevent that classloader from being unloaded.
MODIFY
dd-trace-ot/src/main/java/datadog/opentracing/DDTracer.java
dd-trace-ot/src/main/java/datadog/opentracing/DDTracer.java
@@ -251,6 +251,12 @@ public class DDTracer implements io.opentracing.Tracer, Closeable, datadog.trace
addDecorator(decorator);
}
+ // Ensure that PendingTrace.SPAN_CLEANER is initialized in this thread:
+ try {
+ Class.forName(PendingTrace.class.getName());
+ } catch (final ClassNotFoundException e) {
+ }
+
log.info("New instance: {}", this);
}

Ensure that PendingTrace.SPAN_CLEANER initialized with Tracer

Otherwise it might get initialized by a different classloader which would prevent that classloader from being unloaded.