-
I developed a couple of plugins based on and to use with Java agent 8.16.0. Problem: after every few hundred restarts of a container app, a few errors like I've tried to locate the direct cause by adding or removing plugins or codes I developed, but the result indicates that the error occurs upon a COMPOSITION of factors, so currently it is hard to narrow down. Would there be any advice for addressing the problem? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
AFAIK, |
Beta Was this translation helpful? Give feedback.
-
ClassCircularityError is sometimes made when different threads trying to load through |
Beta Was this translation helpful? Give feedback.
-
@wu-sheng @bert82503 This error is caused by ByteBuddy and a similar issue was proposed there. The usage of To fix this error in the SkyWalking level, preloading // 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("Preload ThreadLocalRandom failure.");
}
} |
Beta Was this translation helpful? Give feedback.
@wu-sheng @bert82503 This error is caused by ByteBuddy and a similar issue was proposed there. The usage of
ConcurrentHashMap
, whoseaddCount()
method usesThreadLocalRandom
if there exists thread contention, was introduced since ByteBuddy 1.12.11 via this commit. By means of ByteBuddy,ClassFileTransformer.transform()
will trigger class loading ofThreadLocalRandom
which is probably being loaded, in which caseClassCircularityError
will be thrown. An issue in the OpenJDK community provides detailed explanations of this exception and proposes to adjust the name of the thrown error message.To fix this error in the SkyWalking level, preloading
ThreadLocalRandom
before calling ByteBuddy wil…