lmolkova opened a new pull request, #8934: URL: https://github.com/apache/camel/pull/8934
Follow up for #8713 and #8911. I was able to repro failures locally and with this change, they are no longer reproducible (tried on 1000 iterations). Fixes flaky `CurrentSpanTest.testContextDoesNotLeak` test. There are severalproblems: 1. We can't guarantee that `ExchangeAsyncProcessingStartedEvent` is fired once and only if span was created 2. We can't guarantee that span ends on the same thread it was started, i.e. scope is closed on the same thread 3. Due to concurrency in async scenarios we can call close on scope two times Unfortunately, OTel scope closing works differently than I thought - https://github.com/open-telemetry/opentelemetry-java/issues/5055 While the solution on OTel side is evaluated, I suggest guarding scope closing. This PR also adds logging in case there is more flakiness. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org