Skip to content

Commit

Permalink
Fix concurrency with callback test on okhttp3 latest (#3676)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit authored Jul 26, 2021
1 parent 6a2ee32 commit b483d7d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package io.opentelemetry.javaagent.instrumentation.okhttp.v3_0;

import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.implementsInterface;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;

Expand All @@ -28,7 +29,9 @@ public ElementMatcher<TypeDescription> typeMatcher() {
@Override
public void transform(TypeTransformer transformer) {
transformer.applyAdviceToMethod(
named("enqueue").and(takesArgument(0, named("okhttp3.RealCall$AsyncCall"))),
named("enqueue")
.or(named("enqueue$okhttp"))
.and(takesArgument(0, implementsInterface(named(Runnable.class.getName())))),
OkHttp3DispatcherInstrumentation.class.getName() + "$AttachStateAdvice");
}

Expand Down

0 comments on commit b483d7d

Please sign in to comment.