Open dniel opened 1 year ago
Tried to upgrade as much as possible
Same problem both when starting the application in IDEA locally on my machine and packaged as a docker container using Temurin JRE 19 as base image.
Tried to downgrade coroutines to 1.6.0 and then 1.5.0 without any change.
Tried to downgrade micronaut to 3.7.0, 3.6.0, 3.5.0, 3.4.0 and all of them fails with same error.
Removed dependency on micronaut-tracing
where the class CoroutineTracingDispatcher
that crash lives.
Now the code doesn't fail but most probably without automatic coroutines context propagation.
Seems like the list invocationInstrumenters
in the constructor to CoroutineTracingDispatcher
has size 1, but the element in the list is null
Expected Behavior
When calling an endpoint that has
suspend
andcoroutineScope
orwithContext
and starting anasync
or even just adelay
like this https://github.com/nsbno/trafficinfo-baseline-micronaut/blob/migrate_to_coroutines/src/main/kotlin/no/vy/trafficinfo/baseline/micronaut/controllers/ChangeController.kt#L112-L124C5 the coroutine should complete and return result from await()Actual Behaviour
Exception is thrown.
If instead using
runBlocking
instead ofcoroutinesScope
like this https://github.com/nsbno/trafficinfo-baseline-micronaut/blob/migrate_to_coroutines/src/main/kotlin/no/vy/trafficinfo/baseline/micronaut/controllers/ChangeController.kt#L94-L105 it works as expected and result is returned from endpoint.Steps To Reproduce
Environment Information
Example Application
https://github.com/nsbno/trafficinfo-baseline-micronaut/tree/migrate_to_coroutines
Version
3.8.0