# Publishers and coroutines hanging issue

**URL:** <https://discuss.kotlinlang.org/t/publishers-and-coroutines-hanging-issue/22836>\
**Category:** Libraries\
**Created:** [August 28, 2021, 5:43am UTC](https://discuss.kotlinlang.org/t/publishers-and-coroutines-hanging-issue/22836 "2021-08-28T05:43:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rawilder](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rawilder](https://discuss.kotlinlang.org/u/rawilder)\
**Post date:** [August 28, 2021, 5:43am UTC](https://discuss.kotlinlang.org/t/publishers-and-coroutines-hanging-issue/22836/1 "2021-08-28T05:43:34Z")

</div>

Hello all, I’m am running into a weird blocking issue with Micronaut 3 + kotlinx-coroutines-reactive with streaming file uploads. Here is the code: [mn-multi-file-upload/TestController.kt at await-from-flux · rawilder/mn-multi-file-upload · GitHub](https://github.com/rawilder/mn-multi-file-upload/blob/await-from-flux/src/main/kotlin/com/example/TestController.kt)

StreamingFileUpload is a Publisher from which I turn into a flux then await the result with one of the kotlinx-coroutines-reactive. What is weird, is that on the first request made to the application, it will hang on the await methods of kotlinx-coroutines-reactive. If I utilize reactor types only, I don’t seem to have the issue. Also it is inconsistent. If I enable trace logging for example, the first request will work sometimes. I assume that it has something to do with the timing of it all.

I’ve tried to debug but I just don’t have enough domain knowledge to know where to start looking (and trace logging keeps working so I can’t see where to look there). Has anyone encountered something similar with composing Publishers with coroutines?

---

<div class="post-metadata">

**Author:** ![rawilder](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rawilder](https://discuss.kotlinlang.org/u/rawilder)\
**Post date:** [September 1, 2021, 5:26am UTC](https://discuss.kotlinlang.org/t/publishers-and-coroutines-hanging-issue/22836/2 "2021-09-01T05:26:09Z")

</div>

I think I might’ve found the root cause. It looks like a dependent lib was cancelling an underlying subscriber and not propagating the cancellation/error which left the kotlin coroutines waiting for a termination signal that never came. This has happened in other scenarios too so I will update as I find more info.
