Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle ConcurrentModificationException in OpenTelemetry #2224

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;

/**
* Controls Jaeger spans, with respect to various events received during Synapse message flow.
Expand Down Expand Up @@ -203,13 +204,13 @@ private void startSpan(StatisticDataUnit statisticDataUnit, MessageContext synCt
Span span;
Map<String, String> tracerSpecificCarrier = new HashMap<>();

Map headersMap = (Map) ((Axis2MessageContext) synCtx).getAxis2MessageContext()
.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
Map headersMap = new ConcurrentHashMap<>((Map) ((Axis2MessageContext) synCtx).getAxis2MessageContext()
.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS));
Object statusCode = ((Axis2MessageContext) synCtx).getAxis2MessageContext().getProperty("HTTP_SC");
Object statusDescription = ((Axis2MessageContext) synCtx).getAxis2MessageContext().getProperty("HTTP_DESC");
// We only need to extract span context from headers when there are trp headers available
if (headersMap == null) {
headersMap = new HashMap();
headersMap = new ConcurrentHashMap();
}
if (isOuterLevelSpan(statisticDataUnit, spanStore)) {
// Extract span context from headers
Expand Down
Loading