Skip to content

Commit cb48d17

Browse files
authored
Merge branch 'master' into zgu/ddprof-release_1.29.0
2 parents de48615 + 76639fb commit cb48d17

File tree

6 files changed

+36
-12
lines changed

6 files changed

+36
-12
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,11 +601,12 @@ agent_integration_tests:
601601
GRADLE_TARGET: "traceAgentTest"
602602
CACHE_TYPE: "base"
603603
services:
604-
- name: datadog/agent:7.34.0
604+
- name: registry.ddbuild.io/images/mirror/datadog/agent:7.40.1
605605
alias: local-agent
606606
variables:
607607
DD_APM_ENABLED: "true"
608608
DD_BIND_HOST: "0.0.0.0"
609+
DD_HOSTNAME: "local-agent"
609610
DD_API_KEY: "invalid_key_but_this_is_fine"
610611

611612
test_base:

BUILDING.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,16 @@ Download and install JDK versions 8, 11, 17, 21 and 24, and GraalVM 17 for your
6969
```shell
7070
brew install --cask zulu@8 zulu@11 zulu@17 zulu@21 zulu graalvm/tap/graalvm-ce-java17
7171
```
72-
* Fix the GraalVM installation by [removing the quarantine flag](https://www.graalvm.org/latest/docs/getting-started/macos/):
72+
* Identify your local version of GraalVM:
73+
```
74+
ls /Library/Java/JavaVirtualMachines | grep graalvm
75+
```
76+
Example: `graalvm-ce-java17-22.3.1`
77+
* Use this version in the following command to fix the GraalVM installation by [removing the quarantine flag](https://www.graalvm.org/latest/docs/getting-started/macos/):
7378
```
7479
sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-<current version of graalvm>
7580
```
81+
Example: `/Library/Java/JavaVirtualMachines/graalvm-ce-java17-22.3.1`
7682
* Add the required environment variables to your shell using the `export` command. You can permanently install the environment variables by appending the `export` commands into your shell configuration file `~/.zshrc` or `.bashrc` or other.
7783
```shell
7884
export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home

dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/events/SmapEntryCache.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ static class AnnotatedRegion {
6262
this.smapsPath = smapsPath;
6363
}
6464

65+
// @VisibleForTesting
66+
void invalidate() {
67+
UPDATER.getAndSet(this, System.nanoTime() - (2 * ttl));
68+
}
69+
6570
@SuppressWarnings("unchecked")
6671
public List<SmapEntryEvent> getEvents() {
6772
long prevTimestamp = lastTimestamp;
@@ -296,9 +301,9 @@ private static Map<Long, String> getAnnotatedRegions() {
296301
return Collections.emptyMap();
297302
}
298303

299-
private static void collectEvents(List<SmapEntryEvent> events) {
304+
private void collectEvents(List<SmapEntryEvent> events) {
300305
try (BufferedReader br =
301-
new BufferedReader(new InputStreamReader(Files.newInputStream(SMAPS_PATH)), 64 * 1024)) {
306+
new BufferedReader(new InputStreamReader(Files.newInputStream(smapsPath)), 64 * 1024)) {
302307
readEvents(br, events);
303308
Map<Long, String> regions = getAnnotatedRegions();
304309
for (SmapEntryEvent e : events) {

dd-java-agent/agent-profiling/profiling-controller-openjdk/src/test/java/com/datadog/profiling/controller/openjdk/events/SmapEntryCacheTest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@ void getEvents() throws Exception {
1818
assumeTrue(OperatingSystem.isLinux());
1919
// We need at least Java 22 for the annotated regions
2020
assumeTrue(JavaVirtualMachine.isJavaVersionAtLeast(22));
21-
SmapEntryCache smapEntryCache = new SmapEntryCache(Duration.ofMillis(100));
21+
SmapEntryCache smapEntryCache =
22+
new SmapEntryCache(Duration.ofHours(1)); // set up a really long expiration duration
2223
List<SmapEntryEvent> events1 = smapEntryCache.getEvents();
2324
List<SmapEntryEvent> events2 = smapEntryCache.getEvents();
2425
// the cache is using double buffered event list so we can use identity comparison
2526
assertSame(events1, events2);
2627

27-
long ts = System.nanoTime();
28-
while (System.nanoTime() - ts < 150_000_000L) { // make sure the cache is expired
29-
Thread.sleep(200);
30-
}
28+
smapEntryCache.invalidate(); // pretend expiring the cache
3129
events1 = smapEntryCache.getEvents();
3230
assertNotSame(events1, events2);
3331
}

dd-trace-core/src/traceAgentTest/groovy/AbstractTraceAgentTest.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ abstract class AbstractTraceAgentTest extends DDSpecification {
1818
and we use 'testcontainers' for this.
1919
*/
2020
if ("true" != System.getenv("CI")) {
21-
agentContainer = new GenericContainer("datadog/agent:7.34.0")
21+
agentContainer = new GenericContainer("datadog/agent:7.40.1")
2222
.withEnv(["DD_APM_ENABLED": "true",
2323
"DD_BIND_HOST" : "0.0.0.0",
2424
"DD_API_KEY" : "invalid_key_but_this_is_fine",
25+
"DD_HOSTNAME" : "doesnotexist",
2526
"DD_LOGS_STDOUT": "yes"])
2627
.withExposedPorts(datadog.trace.api.ConfigDefaults.DEFAULT_TRACE_AGENT_PORT)
2728
.withStartupTimeout(Duration.ofSeconds(120))

gradle/forbiddenapis.gradle

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
buildscript {
22
repositories {
3-
maven {
4-
url "https://plugins.gradle.org/m2/"
3+
mavenLocal()
4+
if (project.rootProject.hasProperty("gradlePluginProxy")) {
5+
maven {
6+
url project.rootProject.property("gradlePluginProxy")
7+
allowInsecureProtocol true
8+
}
59
}
10+
if (project.rootProject.hasProperty("mavenRepositoryProxy")) {
11+
maven {
12+
url project.rootProject.property("mavenRepositoryProxy")
13+
allowInsecureProtocol true
14+
}
15+
}
16+
gradlePluginPortal()
17+
mavenCentral()
618
}
19+
720
dependencies {
821
classpath "de.thetaphi:forbiddenapis:3.8"
922
}

0 commit comments

Comments
 (0)