Fix ContinuableScope bug when parent span was not closed after scope was closed
MODIFY
dd-trace-ot/src/main/java/datadog/opentracing/scopemanager/ContinuableScope.java
dd-trace-ot/src/main/java/datadog/opentracing/scopemanager/ContinuableScope.java
@@ -159,7 +159,10 @@ public class ContinuableScope implements Scope, TraceScope {
if (closeContinuationScope) {
ContinuableScope.this.close();
} else {
- openCount.decrementAndGet();
+ // Same in in 'close()' above.
+ if (openCount.decrementAndGet() == 0 && finishOnClose) {
+ spanUnderScope.finish();
+ }
}
} else {
log.debug("Failed to close continuation {}. Already used.", this);

Fix ContinuableScope bug when parent span was not closed after scope was closed