You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Kotlin Coroutines service/server implementations generated code uses io.grpc.kotlin.AbstractCoroutineServerImpl.
As GRPC generator doesn't create any service interfaces, Spring's AutoProxy aspect weaver cannot use JDK proxies and falls back to CGLIB. io.grpc.kotlin.AbstractCoroutineServerImpl uses val context: CoroutineContext which is a non-open non-overridable property which generates final getter. This results in a situation when CGLIB must generate a new field and doesn't delegate getter call to original proxied target, thus having context set to null.
Having context = null fails generated *CoroutineImplBase#bindService implementations, which expects this.couroutine to be non-null.
Making context as open val context in io.grpc.kotlin.AbstractCoroutineServerImpl will potentially fix the issue as it will allow override and extensions for CGLIB.
In the long run ideally I believe the generated service must have interfaces, to avoid such problems in future and do not depend on abstract classes.