Fix intermittent ClassCircularityError by preloading ThreadLocalRandom since ByteBuddy 1.12.11 (#718)

This commit is contained in:
yizhouw11 2024-09-23 15:32:23 +08:00 committed by GitHub
parent 7536424165
commit 5c4970b519
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -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)

View File

@ -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.
*