-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Async RxJava3 call adapter doesn't produce error event when request is canceled by timeout #3524
Comments
Seems like the issue happens when thread switching happens while
The fix would be to synchronise read and writes to This is the cause for one of the top trending crashes in our product. Is the fix already in pipeline? Please advice any alternatives if possible. Thanks. |
Is there any negative side effect of just leveraging, EDIT: It's also a significant regression from the rxjava2 call adapter, no? |
Apparently this is happening due to this line: Line 85 in b4eed3f
|
in okhttp,when timeout,it will cancel all the call if (call.isCanceled()) return; then ,it will never catch the exception |
Test case/sample:
https://gist.github.com/alapshin/a60540a1a128c0af042b7fe427b9de88
Description
RxJava3CallAdapterFactory.create()
Result
When call time outs Rx stream doesn't receive any event and remains active
Expected result
When call time outs Rx stream receives error event and completes
Additional info
If RxJava3 call adapter is created via
RxJava3CallAdapterFactory.createWithScheduler(Schedulers.io)
then call cancellation by timeout produces exception which is propagated to streamThere is also somewhat related discussion at #3453 with comment
with comment #3453 (comment) which points to possible cause of this difference in behavior.
The text was updated successfully, but these errors were encountered: