Skip to content

Commit ad20d97

Browse files
authored
Fix incorrect span activation for local activities (#910)
What changed? span is incorrectly activated for local activities, this is already activated in activity worker [cadence-java-client/src/main/java/com/uber/cadence/internal/worker/LocalActivityWorker.java](https://github.com/uber/cadence-java-client/blob/95cb139ff9947db730186369a4f4ed34578f85c8/src/main/java/com/uber/cadence/internal/worker/LocalActivityWorker.java#L137)
1 parent 5caf971 commit ad20d97

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/main/java/com/uber/cadence/internal/tracing/TracingPropagator.java

+8-11
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,14 @@ public Span spanForExecuteLocalActivity(Task task) {
101101
// retrieve spancontext from params
102102
SpanContext parent = extract(params.getContext());
103103

104-
Span span =
105-
tracer
106-
.buildSpan(EXECUTE_LOCAL_ACTIVITY)
107-
.ignoreActiveSpan()
108-
.addReference(References.FOLLOWS_FROM, parent)
109-
.withTag(TAG_WORKFLOW_ID, params.getWorkflowExecution().getWorkflowId())
110-
.withTag(TAG_WORKFLOW_RUN_ID, params.getWorkflowExecution().getRunId())
111-
.withTag(TAG_ACTIVITY_TYPE, params.getActivityType().getName())
112-
.start();
113-
tracer.activateSpan(span);
114-
return span;
104+
return tracer
105+
.buildSpan(EXECUTE_LOCAL_ACTIVITY)
106+
.ignoreActiveSpan()
107+
.addReference(References.FOLLOWS_FROM, parent)
108+
.withTag(TAG_WORKFLOW_ID, params.getWorkflowExecution().getWorkflowId())
109+
.withTag(TAG_WORKFLOW_RUN_ID, params.getWorkflowExecution().getRunId())
110+
.withTag(TAG_ACTIVITY_TYPE, params.getActivityType().getName())
111+
.start();
115112
}
116113

117114
public void inject(Map<String, byte[]> headers) {

0 commit comments

Comments
 (0)