# 7 common mistakes you might be making when using Kotlin Coroutines

DevFeed: [7 common mistakes you might be making when using Kotlin Coroutines](<https://devfeed.tech/articles/7-common-mistakes-you-might-be-making-when-using-kotlin-coroutines-25414.md>)

Original publisher: [Read original article](<https://www.lukaslechner.com/7-common-mistakes-you-might-be-making-when-using-kotlin-coroutines/>)

Author: Lukas Lechner

Published: 2021-01-08T11:12:53Z

Content type: article

Language: en

Sources: [Lukas Lechner](<https://devfeed.tech/sources/lukas-lechner.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [cancellation](<https://devfeed.tech/topics/cancellation.md>)

Tags: [allgemein](<https://devfeed.tech/tags/allgemein.md>), [allgemein-kotlin](<https://devfeed.tech/tags/allgemein-kotlin.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [mistakes](<https://devfeed.tech/tags/mistakes.md>)

## AI overview

The excerpt explains that passing a newly created Job to a coroutine builder can break structured concurrency: that Job becomes the coroutine's parent, disconnecting it from the scope's Job, so cancelling the scope may not cancel the coroutine. Use the Job returned by the builder as the handle for later cancellation. The excerpt introduces a second mistake involving installing SupervisorJob to limit exception propagation and sibling cancellation, but ends before explaining the incorrect setup or its solution.

## Source excerpt

In my opinion, Kotlin Coroutines really simplify the way we write asynchronous and concurrent code. However, I identified some common mistakes that many developers make when using Coroutines. This way, our Coroutine now is cancelled when the Scope is cancelled: The suspend functions in the Kotlin standard library (like e.g. `delay()`) are all cooperative regarding Read More The post 7 common mistakes you might be making when using Kotlin Coroutines first appeared on Lukas Lechner.