File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 5757import java .util .List ;
5858import java .util .Map ;
5959import java .util .Objects ;
60+ import java .util .concurrent .ThreadLocalRandom ;
6061import java .util .logging .LogManager ;
6162import java .util .logging .Logger ;
6263import java .util .stream .Stream ;
@@ -123,6 +124,11 @@ private static void installBytebuddyAgent(
123124 EmbeddedInstrumentationProperties .setPropertiesLoader (extensionClassLoader );
124125 setDefineClassHandler ();
125126 FieldBackedImplementationConfiguration .configure (earlyConfig );
127+ // preload ThreadLocalRandom to avoid occasional
128+ // java.lang.ClassCircularityError: java/util/concurrent/ThreadLocalRandom
129+ // see https://github.com/raphw/byte-buddy/issues/1666 and
130+ // https://bugs.openjdk.org/browse/JDK-8164165
131+ ThreadLocalRandom .current ();
126132
127133 AgentBuilder agentBuilder =
128134 new AgentBuilder .Default (
You can’t perform that action at this time.
0 commit comments