Support `aot_training` mode to be used when creating AOT caches by mcculls · Pull Request #10166 · DataDog/dd-trace-java
mcculls
changed the title
Support 'classpath' mode to be used when creating AOT caches
Support aot_training mode to be used when creating AOT caches
In this mode only the agent jar is added to the boot classpath, no services are started. Also workaround potential AOT bug where TraceInterceptor is mistakenly restored from the system class-loader in production, even though it was visible from the boot class-loader during training, resulting in LinkageErrors. Any call to Tracer.addTraceInterceptor from application code in the system class-loader appears to trigger this bug. The workaround is to replace these calls during training with opcodes that pop the tracer and argument, and push the expected return value. This transformation is not persisted, so in production the original method is invoked.
mcculls
deleted the
mcculls/support-classpath-only-mode
branch
This was referenced
Dec 15, 2025This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters