-
Notifications
You must be signed in to change notification settings - Fork 3k
CompositeException Behavior #21
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
Comments
I've moved to |
No. I was able to reproduce it and got stuck by the time Android was Any suggestions for how to even debug this welcome!
|
Here's what I've got so far. Sometimes I can find in the crash reports stack trace like below:
The most interesting part is: Now a simple test, put this code in the
And here's the output. Nothing is printed from
|
The reason of the exception (in my case) is this line in SafeSubscriber.java line 174 I think a buffer solution would be checking if e2 is null. I'm using rxandroid 0.23 and Android 5.0.1 x86 emulator. Hope this can help. |
|
I was getting a similar error whenever I used RetrofitError.getBody inside RxJava Subscriber.onError. Turns out it was being caused by the getBody call itself throwing an exception. Since initCause, setStackTrace, readObject, and addSuppressed all internally throw exceptions - maybe it's related. |
I think this issue is mentioned here http://stackoverflow.com/questions/24860942/observer-onerror-firing-off-inconsistently. |
@farmazon3000 you're right. I'm not sure it still happens in the latest version of Rx, can somebody confirm? |
I'm using
and it does happen. |
Those aren't the latest versions of RxJava and RxAndroid. The latest are: compile 'io.reactivex:rxjava:1.0.14'
compile 'io.reactivex:rxandroid:1.0.1' |
I am on the latest version E/AndroidRuntime: java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
E/AndroidRuntime: at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:62)
E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime: Caused by: rx.exceptions.OnErrorFailedException: Error occurred when trying to propagate error to Observer.onError
E/AndroidRuntime: at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:201)
E/AndroidRuntime: at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:111)
E/AndroidRuntime: at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:137)
E/AndroidRuntime: at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:208)
E/AndroidRuntime: at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:170)
E/AndroidRuntime: at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime: Caused by: rx.exceptions.CompositeException: 2 exceptions occurred.
E/AndroidRuntime: at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:201)
E/AndroidRuntime: at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:111)
E/AndroidRuntime: at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:137)
E/AndroidRuntime: at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:208)
E/AndroidRuntime: at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:170)
E/AndroidRuntime: at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime: Caused by: rx.exceptions.CompositeException$CompositeExceptionCausalChain: Chain of Causes for CompositeException In Order Received =>
E/AndroidRuntime: at crittercism.android.bk.a(Unknown Source)
E/AndroidRuntime: at crittercism.android.bk.<init>(Unknown Source)
E/AndroidRuntime: at crittercism.android.az.a(Unknown Source)
E/AndroidRuntime: at crittercism.android.ay.uncaughtException(Unknown Source)``` |
Looks like it has nothing to do with RxAndroid. Your app's code threw an exception (most likely in your onError handler):
|
I just got it again (this time because I had a TextInputLayout without a child EditText) - but at least I knew what to look for. It would be nice if my own code showed up in the stack trace somewhere. Without that it turns out to be much harder to track down. Key though - it's always because your onError is calling something that is throwing an error of some kind (may be runtime, error, etc - not necessarily a compile time exception). |
This issue is old, and has no clear action to take. The most recent comments are normal errors being incorrectly attributed to this issue. As far as I can tell CE is now behaving in an acceptable manner and even if it wasn't this isn't the project which could change it. |
We're experiencing this issue also in our code. Clearly, its an application issue where somewhere the
So, say the chain throws |
Can we create a very small sample (preferably without using anything On Mon, May 23, 2016 at 1:23 PM Thomas Keller [email protected]
|
Using rxjava 1.1.1 - given this:
I see this:
whereas given this:
I see this:
|
Hrm... but there seems to be more - because none of my actual crashes point me really at |
As a note, this seems to be fixed in ReactiveX/RxJava#3977 and included in RxJava version 1.1.6. |
compile 'io.reactivex.rxjava2:rxandroid:2.0.1' |
The issue seems to still be there in rxjava 2.1.12, rxandroid 2.1.0. |
There are possibly improvements that need to be made specific to Android related to
CompositeException
.History of the discussion and work on this can be found at ReactiveX/RxJava#1405
The text was updated successfully, but these errors were encountered: