vert-x3 / vertx-lang-kotlin

Vert.x for Kotlin
Apache License 2.0
293 stars 67 forks source link

StackOverflowError caused by two yield calls #240

Closed tsegismont closed 11 months ago

tsegismont commented 11 months ago

See #233

As an optimization, VertxCoroutineExecutor used to execute the command immediately if running on the right context (the context provided at creation time or one of its duplicates).

But this is not compliant with the CoroutineDispacther contract: invocations of dispatch should actually defer execution.

Instead, we introduce a custom CoroutineDispatcher that implements isDispatchNeeded. This method shall return false in the optimization can be applied.