-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
SafeSubscriber - report onCompleted unsubscribe error to RxJavaPlugin #3155
Conversation
5e78f01
to
6696d52
Compare
There are a lot of repeated try catch blocks calling the RxJavaPlugins error handler so I've made a |
One of the tests fails. |
I'm going to ponder the issue of throwing after reporting to the error handler a bit. |
I've been looking for a bit of guidance about what to do when
I think given that the contract has been breached it is fair to throw an exception and I think a new wrapper I'd also like to address the case when
So in the existing code if in
In the existing code if in |
I've submitted code that matches my thinking above. It still fails because I haven't amended the existing unit tests associated with throwing. I'll do that after another round of review if accepted. |
The failing test is a coverage test for a behavior no longer present. I suggest removing it and rerunning the jacoco to see if all current code path is covered. |
@akarnokd Yep that's right. Are you happy that a throwing |
a84e3b9
to
ccb3dbd
Compare
I've fixed the unit tests and added more so that |
👍 Looks good to me. Since this adds public API classes, it requires further approval (otherwise it shouldn't affect programs other than those that badly fail, therefore, the merge policy would allow me to merge it). |
safe.onCompleted(); | ||
|
||
assertTrue(safe.isUnsubscribed()); | ||
Assert.fail(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent
LGTM. It would be better if you can fix the indent. 👍 for UnsubscribeFailureException. It's a pity that we cannot change |
ccb3dbd
to
5fec06f
Compare
Great, thanks! |
SafeSubscriber - report onCompleted unsubscribe error to RxJavaPlugin
- Bump to RxJava 1.1.2 because Hystrix 1.5.1 depends on 1.1.1 - Changes expected behaviour in `RxErrorHandlingSpec` - exceptions thrown `onComplete` do not get propagated to `onError`. Related to this change in RxJava (ReactiveX/RxJava#3155), onComplete *must* return normally. - Code snippets in `RxRatpack.java` updated due to `Observable.x` being renamed `Observable.extend` - ReactiveX/RxJava#3423
- Bump to RxJava 1.1.2. Upgrading to 1.1.1, saw test failures in `HystrixRequestCachingSpec` due to `ClassCastException`. I _think_ it may be related to a bug that was fixed in 1.1.2 (ReactiveX/RxJava#3697). - Changes expected behaviour in `RxErrorHandlingSpec` - exceptions thrown `onComplete` do not get propagated to `onError`. Related to this change in RxJava (ReactiveX/RxJava#3155), onComplete *must* return normally. This change went was included in RxJava 1.0.15. - Code snippets in `RxRatpack.java` updated due to `Observable.x` being renamed `Observable.extend` - ReactiveX/RxJava#3423. Also part of RxJava 1.0.15
Discussed in #2464, when an observable emits
onCompleted
butunsubscribe
inSafeSubscriber
throws then the error should be reported to theRxJavaPlugin
error handler and if that fails a stack trace is written toSystem.err
.