Skip to content

Commit 92eab56

Browse files
authored
Remove internal dd.trace.scope.inherit.async.propagation feature flag (#7958)
This flag was added in #1850 (v0.64.0) in case we needed to revert the fixed behaviour, but we have never needed to do that.
1 parent f19e110 commit 92eab56

File tree

9 files changed

+9
-39
lines changed

9 files changed

+9
-39
lines changed

dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/test/groovy/TypeConverterTest.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class TypeConverterTest extends AgentTestRunner {
4545
}
4646

4747
def "should avoid extra allocation for a scope wrapper"() {
48-
def scopeManager = new ContinuableScopeManager(0, false, true)
48+
def scopeManager = new ContinuableScopeManager(0, false)
4949
def context = createTestSpanContext()
5050
def span1 = new DDSpan("test", 0, context, null)
5151
def span2 = new DDSpan("test", 0, context, null)

dd-java-agent/instrumentation/opentracing/api-0.31/src/test/groovy/TypeConverterTest.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class TypeConverterTest extends AgentTestRunner {
5050
}
5151

5252
def "should avoid extra allocation for a scope wrapper"() {
53-
def scopeManager = new ContinuableScopeManager(0, false, true)
53+
def scopeManager = new ContinuableScopeManager(0, false)
5454
def context = createTestSpanContext()
5555
def span1 = new DDSpan("test", 0, context, null)
5656
def span2 = new DDSpan("test", 0, context, null)

dd-java-agent/instrumentation/opentracing/api-0.32/src/test/groovy/TypeConverterTest.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class TypeConverterTest extends AgentTestRunner {
5050
}
5151

5252
def "should avoid extra allocation for a scope wrapper"() {
53-
def scopeManager = new ContinuableScopeManager(0, false, true)
53+
def scopeManager = new ContinuableScopeManager(0, false)
5454
def context = createTestSpanContext()
5555
def span1 = new DDSpan("test", 0, context, null)
5656
def span2 = new DDSpan("test", 0, context, null)

dd-trace-api/src/main/java/datadog/trace/api/config/TracerConfig.java

-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ public final class TracerConfig {
7676

7777
public static final String SCOPE_DEPTH_LIMIT = "trace.scope.depth.limit";
7878
public static final String SCOPE_STRICT_MODE = "trace.scope.strict.mode";
79-
public static final String SCOPE_INHERIT_ASYNC_PROPAGATION =
80-
"trace.scope.inherit.async.propagation";
8179
public static final String SCOPE_ITERATION_KEEP_ALIVE = "trace.scope.iteration.keep.alive";
8280
public static final String PARTIAL_FLUSH_ENABLED = "trace.partial.flush.enabled";
8381
public static final String PARTIAL_FLUSH_MIN_SPANS = "trace.partial.flush.min.spans";

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

-1
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,6 @@ private CoreTracer(
635635
new ContinuableScopeManager(
636636
config.getScopeDepthLimit(),
637637
config.isScopeStrictMode(),
638-
config.isScopeInheritAsyncPropagation(),
639638
profilingContextIntegration,
640639
healthMetrics);
641640
} else {

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

+4-22
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public final class ContinuableScopeManager implements AgentScopeManager {
4848
final boolean strictMode;
4949
private final ScopeStackThreadLocal tlsScopeStack;
5050
private final int depthLimit;
51-
private final boolean inheritAsyncPropagation;
5251
final HealthMetrics healthMetrics;
5352
private final ProfilingContextIntegration profilingContextIntegration;
5453

@@ -57,36 +56,24 @@ public final class ContinuableScopeManager implements AgentScopeManager {
5756
*
5857
* @param depthLimit The maximum scope depth limit, <code>0</code> for unlimited.
5958
* @param strictMode Whether check if the closed spans are the active ones or not.
60-
* @param inheritAsyncPropagation Whether the next span should inherit the active span
61-
* asyncPropagation flag.
6259
*/
63-
public ContinuableScopeManager(
64-
final int depthLimit, final boolean strictMode, final boolean inheritAsyncPropagation) {
65-
this(
66-
depthLimit,
67-
strictMode,
68-
inheritAsyncPropagation,
69-
ProfilingContextIntegration.NoOp.INSTANCE,
70-
HealthMetrics.NO_OP);
60+
public ContinuableScopeManager(final int depthLimit, final boolean strictMode) {
61+
this(depthLimit, strictMode, ProfilingContextIntegration.NoOp.INSTANCE, HealthMetrics.NO_OP);
7162
}
7263

7364
/**
7465
* Default constructor.
7566
*
7667
* @param depthLimit The maximum scope depth limit, <code>0</code> for unlimited.
7768
* @param strictMode Whether check if the closed spans are the active ones or not.
78-
* @param inheritAsyncPropagation Whether the next span should inherit the active span
79-
* asyncPropagation flag.
8069
*/
8170
public ContinuableScopeManager(
8271
final int depthLimit,
8372
final boolean strictMode,
84-
final boolean inheritAsyncPropagation,
8573
final ProfilingContextIntegration profilingContextIntegration,
8674
final HealthMetrics healthMetrics) {
8775
this.depthLimit = depthLimit == 0 ? Integer.MAX_VALUE : depthLimit;
8876
this.strictMode = strictMode;
89-
this.inheritAsyncPropagation = inheritAsyncPropagation;
9077
this.scopeListeners = new CopyOnWriteArrayList<>();
9178
this.extendedScopeListeners = new CopyOnWriteArrayList<>();
9279
this.healthMetrics = healthMetrics;
@@ -141,9 +128,7 @@ private AgentScope activate(
141128
boolean asyncPropagation =
142129
overrideAsyncPropagation
143130
? isAsyncPropagating
144-
: inheritAsyncPropagation && top != null
145-
? top.isAsyncPropagating()
146-
: DEFAULT_ASYNC_PROPAGATING;
131+
: top != null ? top.isAsyncPropagating() : DEFAULT_ASYNC_PROPAGATING;
147132

148133
final ContinuableScope scope =
149134
new ContinuableScope(this, span, source, asyncPropagation, createScopeState(span));
@@ -219,10 +204,7 @@ public AgentScope activateNext(final AgentSpan span) {
219204

220205
final ContinuableScope top = scopeStack.top;
221206

222-
boolean asyncPropagation =
223-
inheritAsyncPropagation && top != null
224-
? top.isAsyncPropagating()
225-
: DEFAULT_ASYNC_PROPAGATING;
207+
boolean asyncPropagation = top != null ? top.isAsyncPropagating() : DEFAULT_ASYNC_PROPAGATING;
226208

227209
final ContinuableScope scope =
228210
new ContinuableScope(

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class PendingTraceBufferTest extends DDSpecification {
3131

3232
def tracer = Mock(CoreTracer)
3333
def traceConfig = Mock(CoreTracer.ConfigSnapshot)
34-
def scopeManager = new ContinuableScopeManager(10, true, true)
34+
def scopeManager = new ContinuableScopeManager(10, true)
3535
def factory = new PendingTrace.Factory(tracer, bufferSpy, SystemTimeSource.INSTANCE, false, HealthMetrics.NO_OP)
3636
List<TraceScope.Continuation> continuations = []
3737

dd-trace-ot/src/test/groovy/datadog/opentracing/TypeConverterTest.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class TypeConverterTest extends DDSpecification {
5252
}
5353

5454
def "should avoid extra allocation for a scope wrapper"() {
55-
def scopeManager = new ContinuableScopeManager(0, false, true)
55+
def scopeManager = new ContinuableScopeManager(0, false)
5656
def context = createTestSpanContext()
5757
def span1 = new DDSpan("test", 0, context, null)
5858
def span2 = new DDSpan("test", 0, context, null)

internal-api/src/main/java/datadog/trace/api/Config.java

-9
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ public static String getHostName() {
174174
private final Set<String> splitByTags;
175175
private final int scopeDepthLimit;
176176
private final boolean scopeStrictMode;
177-
private final boolean scopeInheritAsyncPropagation;
178177
private final int scopeIterationKeepAlive;
179178
private final int partialFlushMinSpans;
180179
private final boolean traceStrictWritesEnabled;
@@ -854,8 +853,6 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins
854853

855854
scopeStrictMode = configProvider.getBoolean(SCOPE_STRICT_MODE, false);
856855

857-
scopeInheritAsyncPropagation = configProvider.getBoolean(SCOPE_INHERIT_ASYNC_PROPAGATION, true);
858-
859856
scopeIterationKeepAlive =
860857
configProvider.getInteger(SCOPE_ITERATION_KEEP_ALIVE, DEFAULT_SCOPE_ITERATION_KEEP_ALIVE);
861858

@@ -2073,10 +2070,6 @@ public boolean isScopeStrictMode() {
20732070
return scopeStrictMode;
20742071
}
20752072

2076-
public boolean isScopeInheritAsyncPropagation() {
2077-
return scopeInheritAsyncPropagation;
2078-
}
2079-
20802073
public int getScopeIterationKeepAlive() {
20812074
return scopeIterationKeepAlive;
20822075
}
@@ -4168,8 +4161,6 @@ public String toString() {
41684161
+ scopeDepthLimit
41694162
+ ", scopeStrictMode="
41704163
+ scopeStrictMode
4171-
+ ", scopeInheritAsyncPropagation="
4172-
+ scopeInheritAsyncPropagation
41734164
+ ", scopeIterationKeepAlive="
41744165
+ scopeIterationKeepAlive
41754166
+ ", partialFlushMinSpans="

0 commit comments

Comments
 (0)