Skip to content

Commit 920ab21

Browse files
committed
Add comment
1 parent 380fa3c commit 920ab21

File tree

1 file changed

+8
-0
lines changed
  • dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,14 @@ private static synchronized void startJmx() {
812812
registerSmapEntryEvent();
813813
if (PROFILER_INIT_AFTER_JMX != null) {
814814
try {
815+
/*
816+
When getJmxStartDelay() is set to 0 we will attempt to initialize the JMX subsystem as soon as available.
817+
But, this can cause issues with JFR as it needs some 'grace period' after JMX is ready. That's why we are
818+
re-scheduling the profiler initialization code just a tad later.
819+
820+
If the jmx start delay is set, we are already delayed relative to the jmx init so we can just plainly
821+
run the initialization code.
822+
*/
815823
if (getJmxStartDelay() == 0) {
816824
log.debug("Waiting for profiler initialization");
817825
AgentTaskScheduler.INSTANCE.scheduleWithJitter(

0 commit comments

Comments
 (0)