Skip to content

Commit 3f18bf9

Browse files
Updated comments
1 parent 7bdce96 commit 3f18bf9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseClientInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public static final class ClientResponseAdvice {
114114
@Advice.OnMethodEnter(suppress = Throwable.class)
115115
public static ContextScope beginResponse(
116116
@Advice.Argument(0) final NHttpClientConnection connection) {
117-
// check and remove context so it won't be finished twice
117+
// don't remove stored context here because the response callback may run multiple times
118118
Context context = (Context) connection.getContext().getAttribute(SYNAPSE_CONTEXT_KEY);
119119
if (null != context) {
120120
return context.attach();

dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseServerInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static final class ServerResponseAdvice {
9393
@Advice.OnMethodEnter(suppress = Throwable.class)
9494
public static ContextScope beginResponse(
9595
@Advice.Argument(0) final NHttpServerConnection connection) {
96-
// check and remove context so it won't be finished twice
96+
// don't remove stored context here because the response callback may run multiple times
9797
Context context = (Context) connection.getContext().getAttribute(SYNAPSE_CONTEXT_KEY);
9898
if (null != context) {
9999
return context.attach();

0 commit comments

Comments
 (0)