[ https://issues.apache.org/jira/browse/CAMEL-21302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17892053#comment-17892053 ]
Claus Ibsen commented on CAMEL-21302: ------------------------------------- Okay so the StrictContextStorage is only used during testing which has a serious overhead as it collects stack-traces for every request and throws exception for double closing. The default storage is thread-local which does not do that, and ignore double closing, so under normal operation this is working faster and better. > camel-opentelemetry context leak with direct async producer > ----------------------------------------------------------- > > Key: CAMEL-21302 > URL: https://issues.apache.org/jira/browse/CAMEL-21302 > Project: Camel > Issue Type: Bug > Components: camel-opentelemetry > Reporter: John Poth > Assignee: Freeman Yue Fang > Priority: Major > Fix For: 4.4.5, 4.8.2, 4.9.0 > > > There seems to be a Otel context leak when using a CXF producer in async > mode. This causes different requests to have the same _traceId._ As a > workaround, setting _synchronous=true_ on the CXF producer resolves the > issue. Here's a reproducer: > {code:java} > @Override > protected RoutesBuilder createRouteBuilder() { > return new RouteBuilder() { > @Override > public void configure() { > from("direct:start").routeId("myRoute") > .to("direct:send") > .end(); > from("direct:send") > .log("message") > .to("cxfrs:http://localhost:" + port1 > + "/rest/helloservice/sayHello?synchronous=false"); > // setting to 'true' resolves the issue > restConfiguration() > .port(port1); > rest("/rest/helloservice") > .post("/sayHello").routeId("rest-GET-say-hi") > .to("direct:sayHi"); > from("direct:sayHi") > .routeId("mock-GET-say-hi") > .log("example") > .to("mock:end"); > }}; > {code} > > I've added the complete unit here: > https://github.com/apache/camel/blob/7d83a62b8e442dc9ac6fd79b153192add940301e/components/camel-opentelemetry/src/test/java/org/apache/camel/opentelemetry/AsyncCxfTest.java -- This message was sent by Atlassian Jira (v8.20.10#820010)