Skip to content

Commit cefdb21

Browse files
committed
build: Bump jafar to 0.26.2, add jafar-parser and jmc flightrecorder-writer aliases
Needed by the JFR-to-OTLP converter (jafar-parser for reading JFR fragments, flightrecorder.writer for generating test recordings). Also excludes scratch .claude/state and relaxes the TempLocationManagerTest concurrent cleanup deadline to 60s.
1 parent 01073d1 commit cefdb21

4 files changed

Lines changed: 28 additions & 7 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,4 @@ mise*.local.toml
9595

9696
# Exclude kotlin build files
9797
.kotlin
98+
.claude/state/

‎dd-java-agent/agent-profiling/build.gradle‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,29 @@ configurations {
4040
runtime {
4141
exclude(group: 'org.slf4j', module: 'slf4j-api')
4242
}
43+
jafarTools
4344
}
45+
dependencies {
46+
jafarTools("io.btrace:jafar-tools:${libs.versions.jafar.get()}") {
47+
transitive = false
48+
}
49+
}
50+
def jafarToolsJar = configurations.jafarTools
4451

4552
tasks.named("shadowJar", ShadowJar) {
4653
dependencies deps.excludeShared
4754

55+
// jafar-tools is a fat jar bundling (an incomplete copy of) the jafar-parser classes.
56+
// The agent only needs the io.jafar.tools classes (used by profiling-scrubber); the bundled
57+
// parser classes lack proper metadata and break the GraalVM native-image builder, so drop
58+
// the fat jar and re-add only the io.jafar.tools classes.
59+
dependencies {
60+
exclude(dependency('io.btrace:jafar-tools:.*'))
61+
}
62+
from({ zipTree(jafarToolsJar.singleFile) }) {
63+
include 'io/jafar/tools/**'
64+
}
65+
4866
// Exclude multi-release versioned classes from jafar-parser.
4967
// These are duplicates of base classes for newer Java APIs and confuse
5068
// the GraalVM native-image builder when the profiling jar is embedded in the agent.

‎gradle/libs.versions.toml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jmh = "1.37"
5050

5151
# Profiling
5252
jmc = "8.1.0"
53-
jafar = "0.16.0"
53+
jafar = "0.26.2"
5454
jol = "0.17"
5555

5656
# Web & Network
@@ -136,6 +136,8 @@ jmc-common = { module = "org.openjdk.jmc:common", version.ref = "jmc" }
136136
jmc-flightrecorder = { module = "org.openjdk.jmc:flightrecorder", version.ref = "jmc" }
137137
jafar-tools = { module = "io.btrace:jafar-tools", version.ref = "jafar" }
138138
jol-core = { module = "org.openjdk.jol:jol-core", version.ref = "jol" }
139+
jmc-flightrecorder-writer = { module = "org.openjdk.jmc:flightrecorder.writer", version.ref = "jmc" }
140+
jafar-parser = { module = "io.btrace:jafar-parser", version.ref = "jafar" }
139141

140142
# Web & Network
141143
jnr-unixsocket = { module = "com.github.jnr:jnr-unixsocket", version.ref = "jnr-unixsocket"}

‎internal-api/src/test/java/datadog/trace/util/TempLocationManagerTest.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ private void syncPoint(boolean timeout) {
159159
withTimeout.compareAndSet(false, timeout);
160160
hookReached.countDown();
161161
try {
162-
if (!proceedSignal.await(30, TimeUnit.SECONDS)) {
162+
if (!proceedSignal.await(60, TimeUnit.SECONDS)) {
163163
cleanupError.set(
164-
new AssertionError("Cleanup thread: proceed signal timeout after 30s"));
164+
new AssertionError("Cleanup thread: proceed signal timeout after 60s"));
165165
}
166166
} catch (InterruptedException e) {
167167
Thread.currentThread().interrupt();
@@ -207,13 +207,13 @@ public FileVisitResult postVisitDirectory(Path dir, IOException exc, boolean tim
207207

208208
try {
209209
assertTrue(
210-
hookReached.await(30, TimeUnit.SECONDS),
211-
"Cleanup thread should reach hook within 30 seconds");
210+
hookReached.await(60, TimeUnit.SECONDS),
211+
"Cleanup thread should reach hook within 60 seconds");
212212
// The visitor may have already deleted the file by this point; tolerate.
213213
Files.deleteIfExists(fakeTempFile);
214214
proceedSignal.countDown();
215-
cleanupThread.join(TimeUnit.SECONDS.toMillis(30));
216-
assertFalse(cleanupThread.isAlive(), "Cleanup should complete within 30s");
215+
cleanupThread.join(TimeUnit.SECONDS.toMillis(60));
216+
assertFalse(cleanupThread.isAlive(), "Cleanup should complete within 60s");
217217

218218
Throwable error = cleanupError.get();
219219
if (error != null) {

0 commit comments

Comments
 (0)