Skip to content

Commit

Permalink
Fix ForkJoinPool sometimes not instrumented (#3293)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Jun 14, 2021
1 parent 7b0be0d commit 8be1006
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ForkJoinPool;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import net.bytebuddy.agent.builder.AgentBuilder;
Expand Down Expand Up @@ -86,6 +87,11 @@ public static Instrumentation getInstrumentation() {
// loading java.lang.reflect.Proxy early here still allows it to be retransformed by the
// internal-proxy instrumentation module after the bytebuddy transformer is set up
Proxy.class.getName();

// caffeine can trigger first access of ForkJoinPool under transform(), which leads ForkJoinPool
// not to get transformed itself.
// loading it early here still allows it to be retransformed as part of agent installation below
ForkJoinPool.class.getName();
}

public static void installBytebuddyAgent(Instrumentation inst) {
Expand Down

0 comments on commit 8be1006

Please sign in to comment.