What kotlin coroutine pattern is PR#11500 trying to patch? #15648
Unanswered
helen-lee-1
asked this question in
Q&A
Replies: 1 comment
-
|
I don't remember the exact details. There is a test in the PR and a reproducer application in #11411 Context propagation for coroutines is handled using https://github.com/open-telemetry/opentelemetry-java/tree/main/extensions/kotlin Propagating the context to the dispatcher shouldn't be necessary. If you believe you have found a bug then please open an issue, include a minimal application that reproduces the problem along with any necessary instructions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! We were trying to update our OTel java agent from 1.32.0 to 2.5.0, and we noticed that context propagation was not happening in our kotlin code that heavily uses coroutine dispatcher. We tracked it down to this change which makes coroutines run with Context.root().makeCurrent() instead of the context that the coroutine was dispatched from. The issue that this PR links to seems like it was related to a runBlocking() method that gets triggered from a main() function, but the change seems to be a broader change that stops context propagation for any coroutine that is dispatched.
Could you share more details about what kotlin coroutine pattern the PR is trying to stop propagation for? This PR was merged a while ago, but there aren't any issues filed about this, so we figured it's some bad calling pattern on our end, but we'd love to understand what pattern this change is targeting.
Beta Was this translation helpful? Give feedback.
All reactions