Marcelo Hernandez10/12/2020, 9:00 PM
has proven, at least for me, to be quite unsafe and can even crash your app. I have several stack traces in https://github.com/Kotlin/kotlinx.coroutines/issues/2104.
, or any operators that cause downstream cancellations where
is used in the downstream may run into race conditions where the Coroutine might get cancelled concurrently while the Rx
is still emitting, causing a
wbertan10/13/2020, 8:08 AM
which then something finished and throw exception and I got
(The code contains a proper error handler - where usually was the reason for this error) So I found this issue in GitHub: https://github.com/ReactiveX/RxJava/issues/4991 with this comment:
This is by design, your Callable crashes and the downstream has disposed so the operator routes the error to the global error handler as it can’t know if the exception is relevant or not. Don’t crash into RxJava and consider using create() with emitter.tryOnError() instead.
So not sure if in my case I would be able to handle better as the comment suggests with
Caused by retrofit2.adapter.rxjava2.HttpException HTTP 404 Client Error
and `emitter.tryOnError()`… Anyway, it was the first time we notice this kind of Exception like this, and it was in our Alpha build (internal), so we will keep an eye and if becomes more often we will act on it.
Marcelo Hernandez10/23/2020, 7:17 PM
crasher has been fixed and will be included in the Coroutines 1.4 release 🎉 https://github.com/Kotlin/kotlinx.coroutines/pull/2333 Thanks @louiscad, @Tash, and @Vsevolod Tolstopyatov [JB] 👏