Skip to content

Commit 5ae921b

Browse files
authored
Do not leak call depth threadlocal in jdbc instrumentation (#7468)
1 parent 29e5ed4 commit 5ae921b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/AbstractPreparedStatementInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ public static AgentScope onEnter(@Advice.This final Statement statement) {
102102
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
103103
public static void stopSpan(
104104
@Advice.Enter final AgentScope scope, @Advice.Thrown final Throwable throwable) {
105+
CallDepthThreadLocalMap.decrementCallDepth(Statement.class);
105106
if (scope == null) {
106107
return;
107108
}
108109
DECORATE.onError(scope.span(), throwable);
109110
DECORATE.beforeFinish(scope.span());
110111
scope.close();
111112
scope.span().finish();
112-
CallDepthThreadLocalMap.reset(Statement.class);
113113
}
114114
}
115115
}

0 commit comments

Comments
 (0)