-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Job.cancel() doesn't dispose SingleSource called via rx2 await() #1671
Comments
Could you please provide a self-contained reproducer?
Thus either we have a sophisticated bug hidden in some complex interaction (and then we definitely need a reproducer to fix it) or it's just a bug in your testing/application code |
I am trying to provide a re-producer but I'm not familiar with testing coroutines. For example I don't know what yield() does here. Would it be ok to provide a small android app example? |
Yes, android app should do the trick. Basically, anything that I can just clone & run will work |
Ok so I've narrowed it down to happening only if Retrofit is used with Rxjava adapter. If it is used with suspend function it cancels correctly |
Here is a reproduction app. I'm not sure if it is a retrofit problem or an rx2 await problem. The workaround is to call |
… integrate with APIs that may block the current thread, but react on cancellation Fixes #1671
Thanks, that really helps! I have a potential fix, but I am not sure whether we can include it in 1.3.3 |
… integrate with APIs that may block the current thread, but react on cancellation Fixes #1671
… integrate with APIs that may block the current thread, but react on cancellation Fixes #1671
… integrate with APIs that may block the current thread, but react on cancellation Fixes #1671
… integrate with APIs that may block the current thread, but react on cancellation (Kotlin#1680) Fixes Kotlin#1671
I have a presenter that implements CoroutineScope and uses a SupervisorJob as the scope job.
Within that presenter, I create a long running network request like this:
Then I quickly cancel the job in the onDestroy function of my presenter
My SingleSource isn't disposed:
The text was updated successfully, but these errors were encountered: