This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git
The following commit(s) were added to refs/heads/main by this push:
new 5c4970b519 Fix intermittent ClassCircularityError by preloading
ThreadLocalRandom since ByteBuddy 1.12.11 (#718)
5c4970b519 is described below
commit 5c4970b51928c867bea2a3d71f78a371b80a4be3
Author: yizhouw11 <[email protected]>
AuthorDate: Mon Sep 23 15:32:23 2024 +0800
Fix intermittent ClassCircularityError by preloading ThreadLocalRandom
since ByteBuddy 1.12.11 (#718)
---
CHANGES.md | 1 +
.../apache/skywalking/apm/agent/core/plugin/PluginBootstrap.java | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/CHANGES.md b/CHANGES.md
index f2534d9be3..57fd985098 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -7,6 +7,7 @@ Release Notes.
* Upgrade nats plugin to support 2.16.5
* Add agent self-observability.
+* Fix intermittent ClassCircularityError by preloading ThreadLocalRandom since
ByteBuddy 1.12.11
All issues and pull requests are
[here](https://github.com/apache/skywalking/milestone/222?closed=1)
diff --git
a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginBootstrap.java
b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginBootstrap.java
index 75c9edc6e0..bea0c3a7fa 100644
---
a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginBootstrap.java
+++
b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginBootstrap.java
@@ -33,6 +33,15 @@ import
org.apache.skywalking.apm.agent.core.logging.api.LogManager;
public class PluginBootstrap {
private static final ILog LOGGER =
LogManager.getLogger(PluginBootstrap.class);
+ // Preload ThreadLocalRandom in case of intermittent ClassCircularityError
since ByteBuddy 1.12.11
+ static {
+ try {
+ Class.forName("java.util.concurrent.ThreadLocalRandom");
+ } catch (Exception e) {
+ LOGGER.warn(e, "Preload ThreadLocalRandom failure.");
+ }
+ }
+
/**
* load all plugins.
*