Kotlin coroutines in a Spring service: three leaks we shipped and what structured concurrency fixed
We run our routing service in Kotlin on Spring Boot. Coroutines were introduced two years ago by enthusiastic people, including me. Here are the three mistakes we made, all of them explained in the kotlinx.coroutines docs, which none of us had read properly. Hence the topic. 1. GlobalScope for fire-and-forget fun ship(order: Order) { GlobalScope.launch { auditClient.record(order.id, "shipped") }…