Skip to content

Commit a77a5e1

Browse files
committed
Remove exemption where we didn't defer if the custom logging manager
or JMX builder was on the system classpath (because the main thread would find it there if OkHttp triggered initialization of JUL.). We now make OkHttp calls from our own background threads, which are isolated from the system classloader, not the main thread - so this exemption no longer makes sense.
1 parent 37acd7b commit a77a5e1

File tree

1 file changed

+2
-15
lines changed
  • dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap

1 file changed

+2
-15
lines changed

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import static datadog.trace.util.AgentThreadFactory.AgentThread.PROFILER_STARTUP;
1111
import static datadog.trace.util.AgentThreadFactory.AgentThread.TRACE_STARTUP;
1212
import static datadog.trace.util.AgentThreadFactory.newAgentThread;
13-
import static datadog.trace.util.Strings.getResourceName;
1413
import static datadog.trace.util.Strings.propertyNameToSystemPropertyName;
1514
import static datadog.trace.util.Strings.toEnvVar;
1615

@@ -1267,14 +1266,8 @@ private static boolean isAppUsingCustomLogManager(final EnumSet<Library> librari
12671266

12681267
final String logManagerProp = System.getProperty("java.util.logging.manager");
12691268
if (logManagerProp != null) {
1270-
final boolean onSysClasspath =
1271-
ClassLoader.getSystemResource(getResourceName(logManagerProp)) != null;
12721269
log.debug("Prop - logging.manager: {}", logManagerProp);
1273-
log.debug("logging.manager on system classpath: {}", onSysClasspath);
1274-
// Some applications set java.util.logging.manager but never actually initialize the logger.
1275-
// Check to see if the configured manager is on the system classpath.
1276-
// If so, it should be safe to initialize jmxfetch which will setup the log manager.
1277-
return !onSysClasspath;
1270+
return true;
12781271
}
12791272

12801273
return false;
@@ -1305,14 +1298,8 @@ private static boolean isAppUsingCustomJMXBuilder(final EnumSet<Library> librari
13051298

13061299
final String jmxBuilderProp = System.getProperty("javax.management.builder.initial");
13071300
if (jmxBuilderProp != null) {
1308-
final boolean onSysClasspath =
1309-
ClassLoader.getSystemResource(getResourceName(jmxBuilderProp)) != null;
13101301
log.debug("Prop - javax.management.builder.initial: {}", jmxBuilderProp);
1311-
log.debug("javax.management.builder.initial on system classpath: {}", onSysClasspath);
1312-
// Some applications set javax.management.builder.initial but never actually initialize JMX.
1313-
// Check to see if the configured JMX builder is on the system classpath.
1314-
// If so, it should be safe to initialize jmxfetch which will setup JMX.
1315-
return !onSysClasspath;
1302+
return true;
13161303
}
13171304

13181305
return false;

0 commit comments

Comments
 (0)