File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -924,6 +924,15 @@ private static synchronized void registerDeadlockDetectionEvent() {
924924
925925 private static synchronized void registerSmapEntryEvent () {
926926 log .debug ("Initializing smap entry scraping" );
927+
928+ // Load JFR Handlers class early, if present (it has been moved and renamed in JDK23+).
929+ // This prevents a deadlock. See https://bugs.openjdk.org/browse/JDK-8371889.
930+ try {
931+ AGENT_CLASSLOADER .loadClass ("jdk.jfr.events.Handlers" );
932+ } catch (Exception e ) {
933+ // Ignore when the class is not found or anything else goes wrong.
934+ }
935+
927936 try {
928937 final Class <?> smapFactoryClass =
929938 AGENT_CLASSLOADER .loadClass (
You can’t perform that action at this time.
0 commit comments