Skip to content

Increase SourceFile tracking max queue size #9271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.datadog.debugger.util.ClassFileHelper;
import com.datadog.debugger.util.ClassNameFiltering;
import datadog.trace.api.Config;
import datadog.trace.relocate.api.RatelimitedLogger;
import datadog.trace.util.AgentTaskScheduler;
import datadog.trace.util.Strings;
import java.lang.instrument.ClassFileTransformer;
Expand All @@ -26,11 +25,8 @@
*/
public class SourceFileTrackingTransformer implements ClassFileTransformer {
private static final Logger LOGGER = LoggerFactory.getLogger(SourceFileTrackingTransformer.class);
private static final int MINUTES_BETWEEN_ERROR_LOG = 5;
static final int MAX_QUEUE_SIZE = 4096;
static final int MAX_QUEUE_SIZE = 16 * 1024;

private final RatelimitedLogger ratelimitedLogger =
new RatelimitedLogger(LOGGER, MINUTES_BETWEEN_ERROR_LOG, TimeUnit.MINUTES);
private final ClassesToRetransformFinder finder;
private final Queue<SourceFileItem> queue = new ConcurrentLinkedQueue<>();
private final AgentTaskScheduler scheduler = AgentTaskScheduler.INSTANCE;
Expand Down Expand Up @@ -93,7 +89,7 @@ public byte[] transform(
return null;
}
if (queueSize.get() >= MAX_QUEUE_SIZE) {
ratelimitedLogger.warn("SourceFile Tracking queue full, dropping class: {}", className);
LOGGER.debug("SourceFile Tracking queue full, dropping class: {}", className);
return null;
}
queue.add(new SourceFileItem(className, classfileBuffer));
Expand Down