Skip to content

Commit 5c4970b

Browse files
authored
Fix intermittent ClassCircularityError by preloading ThreadLocalRandom since ByteBuddy 1.12.11 (#718)
1 parent 7536424 commit 5c4970b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Release Notes.
77

88
* Upgrade nats plugin to support 2.16.5
99
* Add agent self-observability.
10+
* Fix intermittent ClassCircularityError by preloading ThreadLocalRandom since ByteBuddy 1.12.11
1011

1112

1213
All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/222?closed=1)

apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginBootstrap.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@
3333
public class PluginBootstrap {
3434
private static final ILog LOGGER = LogManager.getLogger(PluginBootstrap.class);
3535

36+
// Preload ThreadLocalRandom in case of intermittent ClassCircularityError since ByteBuddy 1.12.11
37+
static {
38+
try {
39+
Class.forName("java.util.concurrent.ThreadLocalRandom");
40+
} catch (Exception e) {
41+
LOGGER.warn(e, "Preload ThreadLocalRandom failure.");
42+
}
43+
}
44+
3645
/**
3746
* load all plugins.
3847
*

0 commit comments

Comments
 (0)