Skip to content

Commit 460a087

Browse files
authored
Merge branch 'master' into ci/update-gradle-dependencies-20250330
2 parents b238c6c + b187a03 commit 460a087

File tree

11 files changed

+48
-18
lines changed

11 files changed

+48
-18
lines changed

.circleci/config.continue.yml.j2

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ instrumentation_modules: &instrumentation_modules "dd-java-agent/instrumentation
3636
debugger_modules: &debugger_modules "dd-java-agent/agent-debugger|dd-java-agent/agent-bootstrap|dd-java-agent/agent-builder|internal-api|communication|dd-trace-core"
3737
profiling_modules: &profiling_modules "dd-java-agent/agent-profiling"
3838

39-
default_system_tests_commit: &default_system_tests_commit 9be8b2793d687c7d9b39f3265fef27b5ec91910c
39+
default_system_tests_commit: &default_system_tests_commit 1de04c42cbd9783432258004e46eb5982bbc9fe5
4040

4141
parameters:
4242
nightly:
@@ -1333,6 +1333,7 @@ build_test_jobs: &build_test_jobs
13331333
matrix:
13341334
<<: *test_matrix
13351335
1336+
{% if ssi_smoke %}
13361337
- tests:
13371338
requires:
13381339
- ok_to_test
@@ -1346,6 +1347,7 @@ build_test_jobs: &build_test_jobs
13461347
maxWorkers: 3
13471348
matrix:
13481349
<<: *test_matrix
1350+
{% endif %}
13491351
13501352
- tests:
13511353
requires:
@@ -1389,6 +1391,7 @@ build_test_jobs: &build_test_jobs
13891391
maxWorkers: 3
13901392
testJvm: "8"
13911393
1394+
{% if ssi_smoke %}
13921395
- tests:
13931396
requires:
13941397
- ok_to_test
@@ -1401,13 +1404,16 @@ build_test_jobs: &build_test_jobs
14011404
parallelism: 4
14021405
maxWorkers: 3
14031406
testJvm: "8"
1407+
{% endif %}
14041408
14051409
- fan_in:
14061410
requires:
14071411
- z_test_<< matrix.testJvm >>_base
14081412
- z_test_<< matrix.testJvm >>_inst
14091413
- z_test_<< matrix.testJvm >>_smoke
1414+
{% if ssi_smoke %}
14101415
- z_test_<< matrix.testJvm >>_ssi_smoke
1416+
{% endif %}
14111417
name: test_<< matrix.testJvm >>
14121418
stage: tracing
14131419
matrix:
@@ -1418,7 +1424,9 @@ build_test_jobs: &build_test_jobs
14181424
- z_test_8_base
14191425
- z_test_8_inst
14201426
- z_test_8_smoke
1427+
{% if ssi_smoke %}
14211428
- z_test_8_ssi_smoke
1429+
{% endif %}
14221430
name: test_8
14231431
stage: tracing
14241432
testJvm: "8"
@@ -1512,6 +1520,14 @@ build_test_jobs: &build_test_jobs
15121520
stage: required
15131521
15141522
workflows:
1523+
{% if skip_circleci %}
1524+
build_test:
1525+
jobs:
1526+
# Just a "required" job to make GitHub PR checks happy, and run nothing else.
1527+
- fan_in:
1528+
name: required
1529+
stage: required
1530+
{% else %}
15151531
{% if is_regular %}
15161532
build_test:
15171533
jobs:
@@ -1552,3 +1568,4 @@ workflows:
15521568
gradleTarget: :profilingTest
15531569
cacheType: profiling
15541570
{% endif %}
1571+
{% endif %}

.circleci/no_circleci_changes.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
git diff --name-only "$1" | grep --invert-match --quiet -E '^(.gitlab-ci.yml|.gitlab)'

.circleci/render_config.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
import os.path
5+
import subprocess
56
import time
67

78
import jinja2
@@ -14,9 +15,10 @@
1415
GENERATED_CONFIG_PATH = os.path.join(SCRIPT_DIR, OUT_FILENAME)
1516

1617
# JDKs that will run on every pipeline.
17-
ALWAYS_ON_JDKS = {"8", "11", "17", "21"}
18+
ALWAYS_ON_JDKS = {"8", "17", "21"}
1819
# And these will run only in master and release/ branches.
1920
MASTER_ONLY_JDKS = {
21+
"11",
2022
"ibm8",
2123
"oracle8",
2224
"semeru8",
@@ -74,6 +76,13 @@
7476
run_all = "all" in labels
7577
is_master_or_release = branch == "master" or branch.startswith("release/v")
7678

79+
skip_circleci = False
80+
if pr_base_ref:
81+
ret = subprocess.call([".circleci/no_circleci_changes.sh", f"{pr_base_ref}..HEAD"], shell=False)
82+
if ret == 1:
83+
# Only GitLab-related files have changed, just skip Circle CI jobs.
84+
skip_circleci = True
85+
7786
if is_master_or_release or run_all:
7887
all_jdks = ALWAYS_ON_JDKS | MASTER_ONLY_JDKS
7988
else:
@@ -99,10 +108,12 @@
99108
"all_jdks": all_jdks,
100109
"all_debugger_jdks": all_debugger_jdks,
101110
"nocov_jdks": nocov_jdks,
102-
"flaky": branch == "master" or "flaky" in labels or "all" in labels,
111+
"flaky": "flaky" in labels or "all" in labels,
103112
"docker_image_prefix": "" if is_nightly else f"{DOCKER_IMAGE_VERSION}-",
104113
"use_git_changes": use_git_changes,
105114
"pr_base_ref": pr_base_ref,
115+
"skip_circleci": skip_circleci,
116+
"ssi_smoke": is_regular and is_master_or_release
106117
}
107118

108119
print(f"Variables for this build: {vars}")

dd-trace-core/src/main/java/datadog/trace/core/PendingTrace.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,8 @@ public void registerContinuation(final AgentScope.Continuation continuation) {
264264
}
265265

266266
@Override
267-
public void cancelContinuation(final AgentScope.Continuation continuation) {
267+
public void removeContinuation(final AgentScope.Continuation continuation) {
268268
decrementRefAndMaybeWrite(false);
269-
healthMetrics.onCancelContinuation();
270269
}
271270

272271
private PublishState decrementRefAndMaybeWrite(boolean isRootSpan) {

dd-trace-core/src/main/java/datadog/trace/core/StreamingTraceCollector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void registerContinuation(AgentScope.Continuation continuation) {
8282
}
8383

8484
@Override
85-
public void cancelContinuation(AgentScope.Continuation continuation) {
85+
public void removeContinuation(AgentScope.Continuation continuation) {
8686
// do nothing
8787
}
8888
}

dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ContinuableScopeManager.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,7 @@ public AgentScope.Continuation captureSpan(final AgentSpan span) {
107107
}
108108

109109
private AgentScope.Continuation captureSpan(final AgentSpan span, byte source) {
110-
ScopeContinuation continuation = new ScopeContinuation(this, span, source);
111-
continuation.register();
112-
healthMetrics.onCaptureContinuation();
113-
return continuation;
110+
return new ScopeContinuation(this, span, source).register();
114111
}
115112

116113
private AgentScope activate(
@@ -207,7 +204,6 @@ public void closePrevious(final boolean finishSpan) {
207204
scopeStack.cleanup();
208205
if (finishSpan) {
209206
top.span.finishWithEndToEnd();
210-
healthMetrics.onFinishContinuation();
211207
}
212208
}
213209
}

dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ScopeContinuation.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ final class ScopeContinuation implements AgentScope.Continuation {
6262

6363
ScopeContinuation register() {
6464
traceCollector.registerContinuation(this);
65+
scopeManager.healthMetrics.onCaptureContinuation();
6566
return this;
6667
}
6768

@@ -95,17 +96,20 @@ public void cancel() {
9596
while (current == 0) {
9697
// no outstanding activations and hold has been removed
9798
if (COUNT.compareAndSet(this, current, CANCELLED)) {
98-
traceCollector.cancelContinuation(this);
99+
traceCollector.removeContinuation(this);
100+
scopeManager.healthMetrics.onFinishContinuation();
99101
return;
100102
}
101103
current = count;
102104
}
105+
scopeManager.healthMetrics.onCancelContinuation();
103106
}
104107

105108
void cancelFromContinuedScopeClose() {
106109
if (COUNT.compareAndSet(this, 1, CANCELLED)) {
107110
// fast path: only one activation of the continuation (no hold)
108-
traceCollector.cancelContinuation(this);
111+
traceCollector.removeContinuation(this);
112+
scopeManager.healthMetrics.onFinishContinuation();
109113
} else if (COUNT.decrementAndGet(this) == 0) {
110114
// slow path: multiple activations, all have now closed (no hold)
111115
cancel();

dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceStrictWriteTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class PendingTraceStrictWriteTest extends PendingTraceTestBase {
5656

5757
when: "continuation is finished the second time"
5858
// Yes this should be guarded by the used flag in the continuation,
59-
// so cancel it anyway to trigger the exception
60-
traceCollector.cancelContinuation(continuation)
59+
// so remove it anyway to trigger the exception
60+
traceCollector.removeContinuation(continuation)
6161

6262
then:
6363
thrown IllegalStateException

internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTraceCollector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
public interface AgentTraceCollector {
44
void registerContinuation(AgentScope.Continuation continuation);
55

6-
void cancelContinuation(AgentScope.Continuation continuation);
6+
void removeContinuation(AgentScope.Continuation continuation);
77
}

internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTracer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ public static class NoopAgentTraceCollector implements AgentTraceCollector {
679679
public void registerContinuation(final AgentScope.Continuation continuation) {}
680680

681681
@Override
682-
public void cancelContinuation(final AgentScope.Continuation continuation) {}
682+
public void removeContinuation(final AgentScope.Continuation continuation) {}
683683
}
684684

685685
public static class NoopAgentHistogram implements AgentHistogram {

0 commit comments

Comments
 (0)