-
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
OnErrorNotImplementedException disrupts Subject event delivery #1685
Comments
The following example hangs ReplaySubject<Object> subject = ReplaySubject.create();
Observable.error(new RuntimeException("oops"))
.materialize()
.delay(1, TimeUnit.SECONDS)
.dematerialize()
.subscribe(subject);
subject.subscribe();
subject.materialize().toBlocking().first();
System.out.println("Done"); where as ReplaySubject<Object> subject = ReplaySubject.create();
Observable.error(new RuntimeException("oops"))
.materialize()
.delay(1, TimeUnit.SECONDS)
.dematerialize()
.subscribe(subject);
subject.subscribe(n -> {}, e -> {});
subject.materialize().toBlocking().first();
System.out.println("Done"); does not. |
The plain |
Is that by design? |
We're trying to see if we need to stop using subscribe() without an onError handler due to this behavior even when we don't need to handle the error notification. |
Yes, it is by design that if an error handler is not provided, but an error occurs it will throw If you want to swallow an error prior to the subscribe you can do something like this: stream.onErrorResumeNext(t -> Observable.empty()).subscribe(); The |
The hang may be that you're not seeing the I haven't confirmed, but you should definitely see an exception be thrown somewhere. |
This one was kind of tricky ... I have to catch the error and wait until all subscribers receive the Great bug. Thanks for reporting this. |
Fixes ReactiveX#1685 by delaying errors that are caught until after all subscribers have a chance to receive the event. Note that this has a lot of code duplication to handle this across the Subject implementations. It may be worth abstracting this logic ... but right now I'm just doing what makes sense to fix this as the Subject abstractions are non-trivial.
No description provided.
The text was updated successfully, but these errors were encountered: